MigrationBuilder.InsertData Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
InsertData(String, String[], String[], Object[,], String) |
Builds an InsertDataOperation to insert multiple rows of seed data values for multiple columns. |
InsertData(String, String[], String[], Object[], String) |
Builds an InsertDataOperation to insert a single row of seed data values. |
InsertData(String, String, String, Object, String) |
Builds an InsertDataOperation to insert a single seed data value for a single column. |
InsertData(String, String, String, Object[], String) |
Builds an InsertDataOperation to insert multiple rows of seed data values for a single column. |
InsertData(String, String[], Object[,], String) |
Builds an InsertDataOperation to insert multiple rows of seed data values for multiple columns. |
InsertData(String, String, Object[], String) |
Builds an InsertDataOperation to insert multiple rows of seed data values for a single column. |
InsertData(String, String, Object, String) |
Builds an InsertDataOperation to insert a single seed data value for a single column. |
InsertData(String, String[], Object[], String) |
Builds an InsertDataOperation to insert a single row of seed data values. |
InsertData(String, String[], String[], Object[,], String)
Builds an InsertDataOperation to insert multiple rows of seed data values for multiple columns.
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation> InsertData (string table, string[] columns, string[] columnTypes, object[,] values, string schema = default);
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation> InsertData (string table, string[] columns, string[] columnTypes, object?[,] values, string? schema = default);
abstract member InsertData : string * string[] * string[] * obj[,] * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation>
override this.InsertData : string * string[] * string[] * obj[,] * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation>
Public Overridable Function InsertData (table As String, columns As String(), columnTypes As String(), values As Object(,), Optional schema As String = Nothing) As OperationBuilder(Of InsertDataOperation)
Parameters
- table
- String
The table into which the data will be inserted.
- columns
- String[]
The names of the columns into which the data will be inserted.
- columnTypes
- String[]
A list of store types for the columns into which data will be inserted.
- values
- Object[,]
The values to insert where each element of the outer array represents a row, and each inner array contains values for each of the columns in 'columns'.
- schema
- String
The schema that contains the table, or null
to use the default schema.
Returns
A builder to allow annotations to be added to the operation.
Remarks
See Database migrations for more information and examples.
Applies to
InsertData(String, String[], String[], Object[], String)
Builds an InsertDataOperation to insert a single row of seed data values.
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation> InsertData (string table, string[] columns, string[] columnTypes, object[] values, string schema = default);
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation> InsertData (string table, string[] columns, string[] columnTypes, object?[] values, string? schema = default);
abstract member InsertData : string * string[] * string[] * obj[] * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation>
override this.InsertData : string * string[] * string[] * obj[] * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation>
Public Overridable Function InsertData (table As String, columns As String(), columnTypes As String(), values As Object(), Optional schema As String = Nothing) As OperationBuilder(Of InsertDataOperation)
Parameters
- table
- String
The table into which the data will be inserted.
- columns
- String[]
The names of the columns into which the data will be inserted.
- columnTypes
- String[]
A list of store types for the columns into which data will be inserted.
- values
- Object[]
The values to insert, one value for each column in 'columns'.
- schema
- String
The schema that contains the table, or null
to use the default schema.
Returns
A builder to allow annotations to be added to the operation.
Remarks
See Database migrations for more information and examples.
Applies to
InsertData(String, String, String, Object, String)
Builds an InsertDataOperation to insert a single seed data value for a single column.
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation> InsertData (string table, string column, string columnType, object value, string schema = default);
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation> InsertData (string table, string column, string columnType, object? value, string? schema = default);
abstract member InsertData : string * string * string * obj * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation>
override this.InsertData : string * string * string * obj * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation>
Public Overridable Function InsertData (table As String, column As String, columnType As String, value As Object, Optional schema As String = Nothing) As OperationBuilder(Of InsertDataOperation)
Parameters
- table
- String
The table into which the data will be inserted.
- column
- String
The name of the column into which the data will be inserted.
- columnType
- String
The store type for the column into which data will be inserted.
- value
- Object
The value to insert.
- schema
- String
The schema that contains the table, or null
to use the default schema.
Returns
A builder to allow annotations to be added to the operation.
Remarks
See Database migrations for more information and examples.
Applies to
InsertData(String, String, String, Object[], String)
Builds an InsertDataOperation to insert multiple rows of seed data values for a single column.
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation> InsertData (string table, string column, string columnType, object[] values, string schema = default);
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation> InsertData (string table, string column, string columnType, object[] values, string? schema = default);
abstract member InsertData : string * string * string * obj[] * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation>
override this.InsertData : string * string * string * obj[] * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation>
Public Overridable Function InsertData (table As String, column As String, columnType As String, values As Object(), Optional schema As String = Nothing) As OperationBuilder(Of InsertDataOperation)
Parameters
- table
- String
The table into which the data will be inserted.
- column
- String
The name of the column into which the data will be inserted.
- columnType
- String
The store type for the column into which data will be inserted.
- values
- Object[]
The values to insert, one value for each row.
- schema
- String
The schema that contains the table, or null
to use the default schema.
Returns
A builder to allow annotations to be added to the operation.
Remarks
See Database migrations for more information and examples.
Applies to
InsertData(String, String[], Object[,], String)
Builds an InsertDataOperation to insert multiple rows of seed data values for multiple columns.
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation> InsertData (string table, string[] columns, object[,] values, string schema = default);
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation> InsertData (string table, string[] columns, object?[,] values, string? schema = default);
abstract member InsertData : string * string[] * obj[,] * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation>
override this.InsertData : string * string[] * obj[,] * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation>
Public Overridable Function InsertData (table As String, columns As String(), values As Object(,), Optional schema As String = Nothing) As OperationBuilder(Of InsertDataOperation)
Parameters
- table
- String
The table into which the data will be inserted.
- columns
- String[]
The names of the columns into which the data will be inserted.
- values
- Object[,]
The values to insert where each element of the outer array represents a row, and each inner array contains values for each of the columns in 'columns'.
- schema
- String
The schema that contains the table, or null
to use the default schema.
Returns
A builder to allow annotations to be added to the operation.
Remarks
See Database migrations for more information and examples.
Applies to
InsertData(String, String, Object[], String)
Builds an InsertDataOperation to insert multiple rows of seed data values for a single column.
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation> InsertData (string table, string column, object[] values, string schema = default);
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation> InsertData (string table, string column, object[] values, string? schema = default);
abstract member InsertData : string * string * obj[] * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation>
override this.InsertData : string * string * obj[] * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation>
Public Overridable Function InsertData (table As String, column As String, values As Object(), Optional schema As String = Nothing) As OperationBuilder(Of InsertDataOperation)
Parameters
- table
- String
The table into which the data will be inserted.
- column
- String
The name of the column into which the data will be inserted.
- values
- Object[]
The values to insert, one value for each row.
- schema
- String
The schema that contains the table, or null
to use the default schema.
Returns
A builder to allow annotations to be added to the operation.
Remarks
See Database migrations for more information and examples.
Applies to
InsertData(String, String, Object, String)
Builds an InsertDataOperation to insert a single seed data value for a single column.
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation> InsertData (string table, string column, object value, string schema = default);
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation> InsertData (string table, string column, object? value, string? schema = default);
abstract member InsertData : string * string * obj * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation>
override this.InsertData : string * string * obj * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation>
Public Overridable Function InsertData (table As String, column As String, value As Object, Optional schema As String = Nothing) As OperationBuilder(Of InsertDataOperation)
Parameters
- table
- String
The table into which the data will be inserted.
- column
- String
The name of the column into which the data will be inserted.
- value
- Object
The value to insert.
- schema
- String
The schema that contains the table, or null
to use the default schema.
Returns
A builder to allow annotations to be added to the operation.
Remarks
See Database migrations for more information and examples.
Applies to
InsertData(String, String[], Object[], String)
Builds an InsertDataOperation to insert a single row of seed data values.
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation> InsertData (string table, string[] columns, object[] values, string schema = default);
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation> InsertData (string table, string[] columns, object?[] values, string? schema = default);
abstract member InsertData : string * string[] * obj[] * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation>
override this.InsertData : string * string[] * obj[] * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation>
Public Overridable Function InsertData (table As String, columns As String(), values As Object(), Optional schema As String = Nothing) As OperationBuilder(Of InsertDataOperation)
Parameters
- table
- String
The table into which the data will be inserted.
- columns
- String[]
The names of the columns into which the data will be inserted.
- values
- Object[]
The values to insert, one value for each column in 'columns'.
- schema
- String
The schema that contains the table, or null
to use the default schema.
Returns
A builder to allow annotations to be added to the operation.
Remarks
See Database migrations for more information and examples.
Applies to
Entity Framework