Share via


ParameterBuilder.String Method

Definition

Creates a new parameter definition to pass String data.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
public System.Data.Entity.Migrations.Model.ParameterModel String (Nullable<int> maxLength = null, Nullable<bool> fixedLength = null, Nullable<bool> unicode = null, string defaultValue = null, string defaultValueSql = null, string name = null, string storeType = null, bool outParameter = false);
member this.String : Nullable<int> * Nullable<bool> * Nullable<bool> * string * string * string * string * bool -> System.Data.Entity.Migrations.Model.ParameterModel
Public Function String (Optional maxLength As Nullable(Of Integer) = null, Optional fixedLength As Nullable(Of Boolean) = null, Optional unicode As Nullable(Of Boolean) = null, Optional defaultValue As String = null, Optional defaultValueSql As String = null, Optional name As String = null, Optional storeType As String = null, Optional outParameter As Boolean = false) As ParameterModel

Parameters

maxLength
Nullable<Int32>

The maximum allowable length of the string data.

fixedLength
Nullable<Boolean>

Value indicating whether or not all data should be padded to the maximum length.

unicode
Nullable<Boolean>

Value indicating whether or not the parameter supports Unicode content.

defaultValue
String

Constant value to use as the default value for this parameter.

defaultValueSql
String

SQL expression used as the default value for this parameter.

name
String

The name of the parameter.

storeType
String

Provider specific data type to use for this parameter.

outParameter
Boolean

A value indicating whether the parameter is an output parameter.

Returns

The newly constructed parameter definition.

Attributes

Applies to