AddColumnOperation 类

定义

用于 MigrationOperation 添加新列的 。

public class AddColumnOperation : Microsoft.EntityFrameworkCore.Migrations.Operations.MigrationOperation
public class AddColumnOperation : Microsoft.EntityFrameworkCore.Migrations.Operations.ColumnOperation
[System.Diagnostics.DebuggerDisplay("ALTER TABLE {Table} ADD {Name}")]
public class AddColumnOperation : Microsoft.EntityFrameworkCore.Migrations.Operations.ColumnOperation
type AddColumnOperation = class
    inherit MigrationOperation
type AddColumnOperation = class
    inherit ColumnOperation
[<System.Diagnostics.DebuggerDisplay("ALTER TABLE {Table} ADD {Name}")>]
type AddColumnOperation = class
    inherit ColumnOperation
Public Class AddColumnOperation
Inherits MigrationOperation
Public Class AddColumnOperation
Inherits ColumnOperation
继承
继承
继承
属性

注解

有关详细信息和示例 ,请参阅数据库迁移

构造函数

AddColumnOperation()

用于 MigrationOperation 添加新列的 。

属性

ClrType

用于 MigrationOperation 添加新列的 。

ClrType

映射到列的属性或属性的 CLR Type

(继承自 ColumnOperation)
Collation

此列的排序规则;如果尚未显式配置排序规则, null 则为 。

(继承自 ColumnOperation)
ColumnType

用于 MigrationOperation 添加新列的 。

ColumnType

列的存储类型,例如“nvarchar (max) ”。

(继承自 ColumnOperation)
Comment

此列的注释

(继承自 ColumnOperation)
ComputedColumnSql

用于 MigrationOperation 添加新列的 。

ComputedColumnSql

用于计算列值的 SQL 表达式( null 如果未计算列)。

(继承自 ColumnOperation)
DefaultValue

用于 MigrationOperation 添加新列的 。

DefaultValue

不为此列显式值插入的行的默认值;如果没有默认值, null 则为默认值。

(继承自 ColumnOperation)
DefaultValueSql

用于 MigrationOperation 添加新列的 。

DefaultValueSql

创建列时用作默认约束的 SQL 表达式,如果没有 null 默认约束,则为 。

(继承自 ColumnOperation)
IsDestructiveChange

指示操作是否可能导致数据库中的数据丢失。

(继承自 MigrationOperation)
IsFixedLength

指示是否将列限制为固定长度数据。

(继承自 ColumnOperation)
IsNullable

用于 MigrationOperation 添加新列的 。

IsNullable

指示列是否可以存储 null 值。

(继承自 ColumnOperation)
IsReadOnly

指示当前对象是否为只读对象。

(继承自 AnnotatableBase)
IsRowVersion

用于 MigrationOperation 添加新列的 。

IsRowVersion

指示此列是否充当自动并发标记,其方式与SQL Server上的“rowversion”/“timestamp”列相同。

(继承自 ColumnOperation)
IsStored

此属性映射到的计算列的值是存储在数据库中,还是在读取时计算得出的值。

(继承自 ColumnOperation)
IsUnicode

用于 MigrationOperation 添加新列的 。

IsUnicode

指示列是否可以包含 Unicode 数据,或者 null 未指定或不适用于此列类型。

(继承自 ColumnOperation)
Item[String]

获取具有给定名称的值批注,如果不存在,则返回 null

(继承自 Annotatable)
MaxLength

用于 MigrationOperation 添加新列的 。

MaxLength

列可以存储的最大数据量,如果未 null 指定或不适用于此列类型,则为 。

(继承自 ColumnOperation)
Name

列名称。

Name

列的名称。

(继承自 ColumnOperation)
Precision

列可以存储的最大位数,如果未 null 指定或不适用于此列类型,则为 。

(继承自 ColumnOperation)
Scale

列可以存储的最大小数位数;如果未指定或不适用于此列类型, null 则为 。

(继承自 ColumnOperation)
Schema

包含表的架构; null 如果应使用默认架构,则为 。

Schema

包含表的架构; null 如果应使用默认架构,则为 。

(继承自 ColumnOperation)
Table

要向其添加列的表。

Table

包含列的表。

(继承自 ColumnOperation)

方法

AddAnnotation(String, Annotation)

向此对象添加批注。 如果已存在具有指定名称的批注,则引发 。

(继承自 Annotatable)
AddAnnotation(String, Object)

向此对象添加批注。 如果已存在具有指定名称的批注,则引发 。

(继承自 Annotatable)
AddAnnotations(IEnumerable<IAnnotation>)

向此对象添加批注。

(继承自 AnnotatableBase)
AddAnnotations(IReadOnlyDictionary<String,Object>)

向此对象添加批注。

(继承自 AnnotatableBase)
AddRuntimeAnnotation(String, Annotation)

向此对象添加运行时批注。 如果已存在具有指定名称的批注,则引发 。

(继承自 AnnotatableBase)
AddRuntimeAnnotation(String, Object)

向此对象添加运行时批注。 如果已存在具有指定名称的批注,则引发 。

(继承自 AnnotatableBase)
AddRuntimeAnnotations(IEnumerable<Annotation>)

向此对象添加运行时批注。

(继承自 AnnotatableBase)
AddRuntimeAnnotations(IReadOnlyDictionary<String,Object>)

向此对象添加运行时批注。

(继承自 AnnotatableBase)
CreateAnnotation(String, Object)

创建新批注。

(继承自 Annotatable)
CreateRuntimeAnnotation(String, Object)

创建新的运行时批注。

(继承自 AnnotatableBase)
EnsureMutable()

如果模型为只读,则引发 。

(继承自 Annotatable)
EnsureReadOnly()

如果模型不是只读的,则引发 。

(继承自 Annotatable)
FindAnnotation(String)

获取具有给定名称的批注,如果不存在,则返回 null

(继承自 Annotatable)
FindRuntimeAnnotation(String)

获取具有给定名称的运行时注释,如果不存在,则返回 null

(继承自 AnnotatableBase)
GetAnnotation(String)

获取具有给定名称的批注,如果不存在,则引发该批注。

(继承自 AnnotatableBase)
GetAnnotations()

获取当前 对象上的所有注释。

(继承自 Annotatable)
GetOrAddAnnotation(String, Object)

向此对象添加批注,或返回现有批注(如果已存在具有指定名称的注释)。

(继承自 Annotatable)
GetOrAddRuntimeAnnotationValue<TValue,TArg>(String, Func<TArg,TValue>, TArg)

获取具有给定名称的运行时注释的值,如果不存在,则添加该值。

(继承自 AnnotatableBase)
GetRuntimeAnnotations()

获取当前 对象上的所有运行时注释。

(继承自 AnnotatableBase)
OnAnnotationSet(String, Annotation, Annotation)

在设置或删除批注时调用。

(继承自 Annotatable)
RemoveAnnotation(String)

从此 对象中删除给定的批注。

(继承自 Annotatable)
RemoveRuntimeAnnotation(String)

从此 对象中删除给定的运行时批注。

(继承自 AnnotatableBase)
SetAnnotation(String, Annotation)

设置存储在给定键下的批注。 如果具有指定名称的批注已存在,则覆盖现有批注。

(继承自 Annotatable)
SetAnnotation(String, Annotation, Annotation)

设置存储在给定键下的批注。 如果具有指定名称的批注已存在,则覆盖现有批注。

(继承自 Annotatable)
SetAnnotation(String, Object)

设置存储在给定键下的批注。 如果具有指定名称的批注已存在,则覆盖现有批注。

(继承自 Annotatable)
SetRuntimeAnnotation(String, Annotation, Annotation)

设置存储在给定键下的运行时注释。 如果具有指定名称的批注已存在,则覆盖现有批注。

(继承自 AnnotatableBase)
SetRuntimeAnnotation(String, Object)

设置存储在给定键下的运行时注释。 如果具有指定名称的批注已存在,则覆盖现有批注。

(继承自 AnnotatableBase)

显式接口实现

IAnnotatable.AddRuntimeAnnotation(String, Object)

向此对象添加运行时批注。 如果已存在具有指定名称的批注,则引发 。

(继承自 AnnotatableBase)
IAnnotatable.FindAnnotation(String)

获取具有给定名称的批注,如果不存在,则返回 null。

(继承自 Annotatable)
IAnnotatable.FindRuntimeAnnotation(String)

获取具有给定名称的运行时注释,如果不存在,则返回 null

(继承自 AnnotatableBase)
IAnnotatable.GetAnnotations()

获取当前 对象上的所有注释。

(继承自 Annotatable)
IAnnotatable.GetRuntimeAnnotations()

获取当前 对象上的所有运行时注释。

(继承自 AnnotatableBase)
IAnnotatable.RemoveRuntimeAnnotation(String)

从此 对象中删除给定的运行时批注。

(继承自 AnnotatableBase)
IAnnotatable.SetRuntimeAnnotation(String, Object)

设置存储在给定键下的运行时注释。 如果具有指定名称的批注已存在,则覆盖现有批注。

(继承自 AnnotatableBase)
IMutableAnnotatable.AddAnnotation(String, Object)

向此对象添加批注。 如果已存在具有指定名称的批注,则引发 。

(继承自 Annotatable)
IMutableAnnotatable.RemoveAnnotation(String)

从此 对象中删除给定的批注。

(继承自 Annotatable)
IMutableAnnotatable.SetOrRemoveAnnotation(String, Object)

设置存储在给定名称下的批注。 如果具有指定名称的批注已存在,则覆盖现有批注。 如果 null 提供了 ,则删除现有批注。

(继承自 Annotatable)
IReadOnlyAnnotatable.FindAnnotation(String)

获取具有给定名称的批注,如果不存在,则返回 null

(继承自 AnnotatableBase)
IReadOnlyAnnotatable.GetAnnotations()

获取当前 对象上的所有注释。

(继承自 AnnotatableBase)
IReadOnlyAnnotatable.Item[String]

获取具有给定名称的批注的值,如果不存在,则返回 null

(继承自 AnnotatableBase)

扩展方法

AnnotationsToDebugString(IAnnotatable, Int32)

获取对象上声明的所有注释的调试字符串。

GetAnnotation(IAnnotatable, String)

获取具有给定名称的批注,如果不存在,则引发该批注。

AddAnnotations(IMutableAnnotatable, IEnumerable<IAnnotation>)

向 对象添加批注。

GetAnnotation(IMutableAnnotatable, String)

获取具有给定名称的批注,如果不存在,则引发该批注。

GetOrAddAnnotation(IMutableAnnotatable, String, String)

获取具有给定键的现有批注,或添加新批注(如果不存在)。

SetOrRemoveAnnotation(IMutableAnnotatable, String, Object)

设置存储在给定名称下的批注。 如果具有指定名称的批注已存在,则覆盖现有批注。 如果 null 提供了 ,则删除现有批注。

适用于