DbMigration.CreateTable Method

 

Adds an operation to create a new table.

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

NameDescription
System_CAPS_protmethodCreateTable<TColumns>(String, Func<ColumnBuilder, TColumns>, IDictionary<String, Object>, Object)

Adds an operation to create a new table. 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.

System_CAPS_protmethodCreateTable<TColumns>(String, Func<ColumnBuilder, TColumns>, Object)

Adds an operation to create a new table. 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.


DbMigration.CreateTable<TColumns> Method (String, Func<ColumnBuilder, TColumns>, IDictionary<String, Object>, Object)

Adds an operation to create a new table. 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.

[SuppressMessageAttribute("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
protected internal TableBuilder<TColumns> CreateTable<TColumns>(
	string name,
	Func<ColumnBuilder, TColumns> columnsAction,
	IDictionary<string, object> annotations,
	object anonymousArguments = null
)

Parameters

name
Type: System.String

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

columnsAction
Type: System.Func<ColumnBuilder, TColumns>

An action that specifies the columns to be included in the table. i.e. t =&gt; new { Id = t.Int(identity: true), Name = t.String() }

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

The custom annotations that exist on the table to be created. May be null or empty.

anonymousArguments
Type: System.Object

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

Return Value

Type: System.Data.Entity.Migrations.Builders.TableBuilder<TColumns>

An object that allows further configuration of the table creation operation.

Type Parameters

TColumns

The columns in this create table operation. You do not need to specify this type, it will be inferred from the columnsAction parameter you supply.


DbMigration.CreateTable<TColumns> Method (String, Func<ColumnBuilder, TColumns>, Object)

Adds an operation to create a new table. 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.

[SuppressMessageAttribute("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
protected internal TableBuilder<TColumns> CreateTable<TColumns>(
	string name,
	Func<ColumnBuilder, TColumns> columnsAction,
	object anonymousArguments = null
)

Parameters

name
Type: System.String

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

columnsAction
Type: System.Func<ColumnBuilder, TColumns>

An action that specifies the columns to be included in the table. i.e. t =&gt; new { Id = t.Int(identity: true), Name = t.String() }

anonymousArguments
Type: System.Object

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

Return Value

Type: System.Data.Entity.Migrations.Builders.TableBuilder<TColumns>

An object that allows further configuration of the table creation operation.

Type Parameters

TColumns

The columns in this create table operation. You do not need to specify this type, it will be inferred from the columnsAction parameter you supply.