AddColumnOperation Class

Definition

A MigrationOperation to add a new column.

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
Inheritance
Inheritance
Inheritance
Attributes

Remarks

See Database migrations for more information and examples.

Constructors

AddColumnOperation()

Properties

ClrType
ClrType

The CLR Type of the property or properties mapped to the column.

(Inherited from ColumnOperation)
Collation

The collation for this column, or null if one hasn't been explicitly configured.

(Inherited from ColumnOperation)
ColumnType
ColumnType

The store type of the column--for example, 'nvarchar(max)'.

(Inherited from ColumnOperation)
Comment

Comment for this column

(Inherited from ColumnOperation)
ComputedColumnSql
ComputedColumnSql

The SQL expression to use to compute the column value, null if the column is not computed.

(Inherited from ColumnOperation)
DefaultValue
DefaultValue

The default value for rows inserted without an explicit value for this column, or null if there is no default.

(Inherited from ColumnOperation)
DefaultValueSql
DefaultValueSql

The SQL expression to use as the default constraint when creating the column, or null if there is no default constraint.

(Inherited from ColumnOperation)
IsDestructiveChange

Indicates whether or not the operation might result in loss of data in the database.

(Inherited from MigrationOperation)
IsFixedLength

Indicates whether or not the column is constrained to fixed-length data.

(Inherited from ColumnOperation)
IsNullable
IsNullable

Indicates whether or not th column can store null values.

(Inherited from ColumnOperation)
IsReadOnly

Indicates whether the current object is read-only.

(Inherited from AnnotatableBase)
IsRowVersion
IsRowVersion

Indicates whether or not this column acts as an automatic concurrency token in the same vein as 'rowversion'/'timestamp' columns on SQL Server.

(Inherited from ColumnOperation)
IsStored

Whether the value of the computed column this property is mapped to is stored in the database, or calculated when it is read.

(Inherited from ColumnOperation)
IsUnicode
IsUnicode

Indicates whether or not the column can contain Unicode data, or null if this is not specified or does not apply to this column type.

(Inherited from ColumnOperation)
Item[String]

Gets the value annotation with the given name, returning null if it does not exist.

(Inherited from Annotatable)
MaxLength
MaxLength

The maximum amount of data that the column can store, or null if this is not specified or does not apply to this column type.

(Inherited from ColumnOperation)
Name

The column name.

Name

The name of the column.

(Inherited from ColumnOperation)
Precision

The maximum number of digits that the column can store, or null if this is not specified or does not apply to this column type.

(Inherited from ColumnOperation)
Scale

The maximum number of decimal places that the column can store, or null if this is not specified or does not apply to this column type.

(Inherited from ColumnOperation)
Schema

The schema that contains the table, or null if the default schema should be used.

Schema

The schema that contains the table, or null if the default schema should be used.

(Inherited from ColumnOperation)
Table

The table to which the column will be added.

Table

The table which contains the column.

(Inherited from ColumnOperation)

Methods

AddAnnotation(String, Annotation)

Adds an annotation to this object. Throws if an annotation with the specified name already exists.

(Inherited from Annotatable)
AddAnnotation(String, Object)

Adds an annotation to this object. Throws if an annotation with the specified name already exists.

(Inherited from Annotatable)
AddAnnotations(IEnumerable<IAnnotation>)

Adds annotations to this object.

(Inherited from AnnotatableBase)
AddAnnotations(IReadOnlyDictionary<String,Object>)

Adds annotations to this object.

(Inherited from AnnotatableBase)
AddRuntimeAnnotation(String, Annotation)

Adds a runtime annotation to this object. Throws if an annotation with the specified name already exists.

(Inherited from AnnotatableBase)
AddRuntimeAnnotation(String, Object)

Adds a runtime annotation to this object. Throws if an annotation with the specified name already exists.

(Inherited from AnnotatableBase)
AddRuntimeAnnotations(IEnumerable<Annotation>)

Adds runtime annotations to this object.

(Inherited from AnnotatableBase)
AddRuntimeAnnotations(IReadOnlyDictionary<String,Object>)

Adds runtime annotations to this object.

(Inherited from AnnotatableBase)
CreateAnnotation(String, Object)

Creates a new annotation.

(Inherited from Annotatable)
CreateRuntimeAnnotation(String, Object)

Creates a new runtime annotation.

(Inherited from AnnotatableBase)
EnsureMutable()

Throws if the model is read-only.

(Inherited from Annotatable)
EnsureReadOnly()

Throws if the model is not read-only.

(Inherited from Annotatable)
FindAnnotation(String)

Gets the annotation with the given name, returning null if it does not exist.

(Inherited from Annotatable)
FindRuntimeAnnotation(String)

Gets the runtime annotation with the given name, returning null if it does not exist.

(Inherited from AnnotatableBase)
GetAnnotation(String)

Gets the annotation with the given name, throwing if it does not exist.

(Inherited from AnnotatableBase)
GetAnnotations()

Gets all annotations on the current object.

(Inherited from Annotatable)
GetOrAddAnnotation(String, Object)

Adds an annotation to this object or returns the existing annotation if one with the specified name already exists.

(Inherited from Annotatable)
GetOrAddRuntimeAnnotationValue<TValue,TArg>(String, Func<TArg,TValue>, TArg)

Gets the value of the runtime annotation with the given name, adding it if one does not exist.

(Inherited from AnnotatableBase)
GetRuntimeAnnotations()

Gets all runtime annotations on the current object.

(Inherited from AnnotatableBase)
OnAnnotationSet(String, Annotation, Annotation)

Called when an annotation was set or removed.

(Inherited from Annotatable)
RemoveAnnotation(String)

Removes the given annotation from this object.

(Inherited from Annotatable)
RemoveRuntimeAnnotation(String)

Removes the given runtime annotation from this object.

(Inherited from AnnotatableBase)
SetAnnotation(String, Annotation)

Sets the annotation stored under the given key. Overwrites the existing annotation if an annotation with the specified name already exists.

(Inherited from Annotatable)
SetAnnotation(String, Annotation, Annotation)

Sets the annotation stored under the given key. Overwrites the existing annotation if an annotation with the specified name already exists.

(Inherited from Annotatable)
SetAnnotation(String, Object)

Sets the annotation stored under the given key. Overwrites the existing annotation if an annotation with the specified name already exists.

(Inherited from Annotatable)
SetRuntimeAnnotation(String, Annotation, Annotation)

Sets the runtime annotation stored under the given key. Overwrites the existing annotation if an annotation with the specified name already exists.

(Inherited from AnnotatableBase)
SetRuntimeAnnotation(String, Object)

Sets the runtime annotation stored under the given key. Overwrites the existing annotation if an annotation with the specified name already exists.

(Inherited from AnnotatableBase)

Explicit Interface Implementations

IAnnotatable.AddRuntimeAnnotation(String, Object)

Adds a runtime annotation to this object. Throws if an annotation with the specified name already exists.

(Inherited from AnnotatableBase)
IAnnotatable.FindAnnotation(String)

Gets the annotation with the given name, returning null if it does not exist.

(Inherited from Annotatable)
IAnnotatable.FindRuntimeAnnotation(String)

Gets the runtime annotation with the given name, returning null if it does not exist.

(Inherited from AnnotatableBase)
IAnnotatable.GetAnnotations()

Gets all annotations on the current object.

(Inherited from Annotatable)
IAnnotatable.GetRuntimeAnnotations()

Gets all the runtime annotations on the current object.

(Inherited from AnnotatableBase)
IAnnotatable.RemoveRuntimeAnnotation(String)

Removes the given runtime annotation from this object.

(Inherited from AnnotatableBase)
IAnnotatable.SetRuntimeAnnotation(String, Object)

Sets the runtime annotation stored under the given key. Overwrites the existing annotation if an annotation with the specified name already exists.

(Inherited from AnnotatableBase)
IMutableAnnotatable.AddAnnotation(String, Object)

Adds an annotation to this object. Throws if an annotation with the specified name already exists.

(Inherited from Annotatable)
IMutableAnnotatable.RemoveAnnotation(String)

Removes the given annotation from this object.

(Inherited from Annotatable)
IMutableAnnotatable.SetOrRemoveAnnotation(String, Object)

Sets the annotation stored under the given name. Overwrites the existing annotation if an annotation with the specified name already exists. Removes the existing annotation if null is supplied.

(Inherited from Annotatable)
IReadOnlyAnnotatable.FindAnnotation(String)

Gets the annotation with the given name, returning null if it does not exist.

(Inherited from AnnotatableBase)
IReadOnlyAnnotatable.GetAnnotations()

Gets all annotations on the current object.

(Inherited from AnnotatableBase)
IReadOnlyAnnotatable.Item[String]

Gets the value of the annotation with the given name, returning null if it does not exist.

(Inherited from AnnotatableBase)

Extension Methods

AnnotationsToDebugString(IAnnotatable, Int32)

Gets the debug string for all annotations declared on the object.

GetAnnotation(IAnnotatable, String)

Gets the annotation with the given name, throwing if it does not exist.

AddAnnotations(IMutableAnnotatable, IEnumerable<IAnnotation>)

Adds annotations to an object.

GetAnnotation(IMutableAnnotatable, String)

Gets the annotation with the given name, throwing if it does not exist.

GetOrAddAnnotation(IMutableAnnotatable, String, String)

Gets the existing annotation with a given key, or adds a new annotation if one does not exist.

SetOrRemoveAnnotation(IMutableAnnotatable, String, Object)

Sets the annotation stored under the given name. Overwrites the existing annotation if an annotation with the specified name already exists. Removes the existing annotation if null is supplied.

Applies to