语言

ColumnBuilder.Int 方法

定义

重载

名称 说明
Int(Nullable<Boolean>, Boolean, Nullable<Int32>, String, String, String)

创建新的列定义来存储整数数据。

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

创建新的列定义来存储整数数据。

实体框架迁移 API 不设计为接受不受信任的源提供的输入(例如应用程序的最终用户)。 如果从此类源接受输入,则应在传递给这些 API 之前对其进行验证,以防止 SQL 注入攻击等。

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

创建新的列定义来存储整数数据。

public System.Data.Entity.Migrations.Model.ColumnModel Int(Nullable<bool> nullable = null, bool identity = false, Nullable<int> defaultValue = null, string defaultValueSql = null, string name = null, string storeType = null);
member this.Int : Nullable<bool> * bool * Nullable<int> * string * string * string -> System.Data.Entity.Migrations.Model.ColumnModel
Public Function Int (Optional nullable As Nullable(Of Boolean) = null, Optional identity As Boolean = false, Optional defaultValue As Nullable(Of Integer) = null, Optional defaultValueSql As String = null, Optional name As String = null, Optional storeType As String = null) As ColumnModel

参数

nullable
Nullable<Boolean>

指示列是否允许 null 值的值。

identity
Boolean

指示在插入期间数据库是否生成此列的值的值。

defaultValue
Nullable<Int32>

要用作此列的默认值的常量值。

defaultValueSql
String

用作此列的默认值的 SQL 表达式。

name
String

列的名称。

storeType
String

要用于此列的提供程序特定的数据类型。

返回

新构造的列定义。

适用于

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

创建新的列定义来存储整数数据。

实体框架迁移 API 不设计为接受不受信任的源提供的输入(例如应用程序的最终用户)。 如果从此类源接受输入,则应在传递给这些 API 之前对其进行验证,以防止 SQL 注入攻击等。

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
public System.Data.Entity.Migrations.Model.ColumnModel Int(Nullable<bool> nullable = null, bool identity = false, Nullable<int> 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.Int : Nullable<bool> * bool * Nullable<int> * string * string * string * System.Collections.Generic.IDictionary<string, System.Data.Entity.Infrastructure.Annotations.AnnotationValues> -> System.Data.Entity.Migrations.Model.ColumnModel
Public Function Int (Optional nullable As Nullable(Of Boolean) = null, Optional identity As Boolean = false, Optional defaultValue As Nullable(Of Integer) = 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

参数

nullable
Nullable<Boolean>

指示列是否允许 null 值的值。

identity
Boolean

指示在插入期间数据库是否生成此列的值的值。

defaultValue
Nullable<Int32>

要用作此列的默认值的常量值。

defaultValueSql
String

用作此列的默认值的 SQL 表达式。

name
String

列的名称。

storeType
String

要用于此列的提供程序特定的数据类型。

annotations
IDictionary<String,AnnotationValues>

自定义批注通常来自 Code First 模型。

返回

新构造的列定义。

特性

适用于