Share via


ColumnBuilder.String Method

Definition

Overloads

String(Nullable<Boolean>, Nullable<Int32>, Nullable<Boolean>, Nullable<Boolean>, Nullable<Boolean>, String, String, String, String)

Creates a new column definition to store String data.

String(Nullable<Boolean>, Nullable<Int32>, Nullable<Boolean>, Nullable<Boolean>, String, String, String, String, IDictionary<String, AnnotationValues>)

Creates a new column definition to store 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.

String(Nullable<Boolean>, Nullable<Int32>, Nullable<Boolean>, Nullable<Boolean>, Nullable<Boolean>, String, String, String, String)

Creates a new column definition to store String data.

public System.Data.Entity.Migrations.Model.ColumnModel String (Nullable<bool> nullable = null, Nullable<int> maxLength = null, Nullable<bool> fixedLength = null, Nullable<bool> isMaxLength = null, Nullable<bool> unicode = null, string defaultValue = null, string defaultValueSql = null, string name = null, string storeType = null);
member this.String : Nullable<bool> * Nullable<int> * Nullable<bool> * Nullable<bool> * Nullable<bool> * string * string * string * string -> System.Data.Entity.Migrations.Model.ColumnModel
Public Function String (Optional nullable As Nullable(Of Boolean) = null, Optional maxLength As Nullable(Of Integer) = null, Optional fixedLength As Nullable(Of Boolean) = null, Optional isMaxLength 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) As ColumnModel

Parameters

nullable
Nullable<Boolean>

Value indicating whether or not the column allows null values.

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.

isMaxLength
Nullable<Boolean>

Value indicating whether or not the maximum length supported by the database provider should be used.

unicode
Nullable<Boolean>

Value indicating whether or not the column supports Unicode content.

defaultValue
String

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

defaultValueSql
String

SQL expression used as the default value for this column.

name
String

The name of the column.

storeType
String

Provider specific data type to use for this column.

Returns

The newly constructed column definition.

Applies to

String(Nullable<Boolean>, Nullable<Int32>, Nullable<Boolean>, Nullable<Boolean>, String, String, String, String, IDictionary<String, AnnotationValues>)

Creates a new column definition to store 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.Performance", "CA1822:MarkMembersAsStatic")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
public System.Data.Entity.Migrations.Model.ColumnModel String (Nullable<bool> nullable = null, Nullable<int> maxLength = null, Nullable<bool> fixedLength = null, Nullable<bool> unicode = null, string defaultValue = null, string defaultValueSql = null, string name = null, string storeType = null, System.Collections.Generic.IDictionary<string,System.Data.Entity.Infrastructure.Annotations.AnnotationValues> annotations = null);
member this.String : Nullable<bool> * Nullable<int> * Nullable<bool> * Nullable<bool> * string * string * string * string * System.Collections.Generic.IDictionary<string, System.Data.Entity.Infrastructure.Annotations.AnnotationValues> -> System.Data.Entity.Migrations.Model.ColumnModel
Public Function String (Optional nullable As Nullable(Of Boolean) = null, 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 annotations As IDictionary(Of String, AnnotationValues) = null) As ColumnModel

Parameters

nullable
Nullable<Boolean>

Value indicating whether or not the column allows null values.

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 column supports Unicode content.

defaultValue
String

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

defaultValueSql
String

SQL expression used as the default value for this column.

name
String

The name of the column.

storeType
String

Provider specific data type to use for this column.

annotations
IDictionary<String,AnnotationValues>

Custom annotations usually from the Code First model.

Returns

The newly constructed column definition.

Attributes

Applies to