Share via


DbMigration.CreateTable Method

Definition

Overloads

CreateTable<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.

CreateTable<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.

CreateTable<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.

protected internal System.Data.Entity.Migrations.Builders.TableBuilder<TColumns> CreateTable<TColumns> (string name, Func<System.Data.Entity.Migrations.Builders.ColumnBuilder,TColumns> columnsAction, object anonymousArguments = null);
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
protected internal System.Data.Entity.Migrations.Builders.TableBuilder<TColumns> CreateTable<TColumns> (string name, Func<System.Data.Entity.Migrations.Builders.ColumnBuilder,TColumns> columnsAction, object anonymousArguments = null);
member this.CreateTable : string * Func<System.Data.Entity.Migrations.Builders.ColumnBuilder, 'Columns> * obj -> System.Data.Entity.Migrations.Builders.TableBuilder<'Columns>
Protected Friend Function CreateTable(Of TColumns) (name As String, columnsAction As Func(Of ColumnBuilder, TColumns), Optional anonymousArguments As Object = null) As TableBuilder(Of TColumns)

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.

Parameters

name
String

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

columnsAction
Func<ColumnBuilder,TColumns>

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

anonymousArguments
Object

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

Returns

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

Attributes

Applies to

CreateTable<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.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
protected internal System.Data.Entity.Migrations.Builders.TableBuilder<TColumns> CreateTable<TColumns> (string name, Func<System.Data.Entity.Migrations.Builders.ColumnBuilder,TColumns> columnsAction, System.Collections.Generic.IDictionary<string,object> annotations, object anonymousArguments = null);
member this.CreateTable : string * Func<System.Data.Entity.Migrations.Builders.ColumnBuilder, 'Columns> * System.Collections.Generic.IDictionary<string, obj> * obj -> System.Data.Entity.Migrations.Builders.TableBuilder<'Columns>
Protected Friend Function CreateTable(Of TColumns) (name As String, columnsAction As Func(Of ColumnBuilder, TColumns), annotations As IDictionary(Of String, Object), Optional anonymousArguments As Object = null) As TableBuilder(Of TColumns)

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.

Parameters

name
String

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

columnsAction
Func<ColumnBuilder,TColumns>

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

annotations
IDictionary<String,Object>

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

anonymousArguments
Object

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

Returns

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

Attributes

Applies to