Share via


DbMigration.AlterColumn Method

Definition

Adds an operation to alter the definition of an existing column.

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.

protected internal void AlterColumn (string table, string name, Func<System.Data.Entity.Migrations.Builders.ColumnBuilder,System.Data.Entity.Migrations.Model.ColumnModel> columnAction, object anonymousArguments = null);
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
protected internal void AlterColumn (string table, string name, Func<System.Data.Entity.Migrations.Builders.ColumnBuilder,System.Data.Entity.Migrations.Model.ColumnModel> columnAction, object anonymousArguments = null);
member this.AlterColumn : string * string * Func<System.Data.Entity.Migrations.Builders.ColumnBuilder, System.Data.Entity.Migrations.Model.ColumnModel> * obj -> unit
Protected Friend Sub AlterColumn (table As String, name As String, columnAction As Func(Of ColumnBuilder, ColumnModel), Optional anonymousArguments As Object = null)

Parameters

table
String

The name of the table the column exists in. Schema name is optional, if no schema is specified then dbo is assumed.

name
String

The name of the column to be changed.

columnAction
Func<ColumnBuilder,ColumnModel>

An action that specifies the new definition for the column. i.e. c => c.String(nullable: false, defaultValue: "none")

anonymousArguments
Object

Additional arguments that may be processed by providers. Use anonymous type syntax to specify arguments e.g. 'new { SampleArgument = "MyValue" }'.

Attributes

Applies to