ColumnBuilder.Binary Method (Nullable<Boolean>, Nullable<Int32>, Nullable<Boolean>, Byte[], String, Boolean, String, String, IDictionary<String, AnnotationValues>)

 

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

Namespace:   System.Data.Entity.Migrations.Builders
Assembly:  EntityFramework (in EntityFramework.dll)

[SuppressMessageAttribute("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
[SuppressMessageAttribute("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
public ColumnModel Binary(
	Nullable<bool> nullable = null,
	Nullable<int> maxLength = null,
	Nullable<bool> fixedLength = null,
	byte[] defaultValue = null,
	string defaultValueSql = null,
	bool timestamp = false,
	string name = null,
	string storeType = null,
	IDictionary<string, AnnotationValues> annotations = null
)

Parameters

nullable
Type: System.Nullable<Boolean>

Value indicating whether or not the column allows null values.

maxLength
Type: System.Nullable<Int32>

The maximum allowable length of the array data.

fixedLength
Type: System.Nullable<Boolean>

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

defaultValue
Type: System.Byte[]

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

defaultValueSql
Type: System.String

SQL expression used as the default value for this column.

timestamp
Type: System.Boolean

Value indicating whether or not this column should be configured as a timestamp.

name
Type: System.String

The name of the column.

storeType
Type: System.String

Provider specific data type to use for this column.

annotations
Type: System.Collections.Generic.IDictionary<String, AnnotationValues>

Custom annotations usually from the Code First model.

Return Value

Type: System.Data.Entity.Migrations.Model.ColumnModel

The newly constructed column definition.