Skip to content

TQueryCrudExtensions_InsertListAndReturnIds_q_tRbiB9s8+xcMpSip9UxQ

Jacob Spitzer edited this page Aug 28, 2022 · 2 revisions

TQueryCrudExtensions.InsertListAndReturnIds<Table>(DbEc<Table>, List<Table>, string) Method

Inserts a list of entities into table and returns a list of identity ids.

public static System.Collections.Generic.IEnumerable<int> InsertListAndReturnIds<Table>(this DbEasyConnect.DbEc<Table> tQuery, System.Collections.Generic.List<Table> entities, string keyColumnName="Id");

Type parameters

Table
The type of the records of table class. need to be a class with the [Table("")] attribute.

Parameters

tQuery DbEasyConnect.DbEc<Table>
An DbEc<T> to perform the insert command.

entities System.Collections.Generic.List<Table>
An list of entities to insert.

keyColumnName System.String
The column that contains the Key/Id that will be used to return

Returns

System.Collections.Generic.IEnumerable<System.Int32>
List of identity ids of the new inserted records.

Clone this wiki locally