Class DataExtensions
public static class DataExtensions
- Inheritance
-
DataExtensions
- Inherited Members
Methods
RetrieveIdentity<T>(IEnumerable<T>, DataConnection, bool, bool)
Initializes source columns, marked with IsIdentity or IdentityAttribute with identity values:
- if column had sequence name set using SequenceNameAttribute and
useSequenceNameset totrue, values from sequence used. Implemented for: Oracle, PostgreSQL - if table has identity configured and
useIdentityset totrue, values from sequence used. Implemented for: SQL Server 2005+ - Otherwise column initialized with values, incremented by 1 starting with max value from database for this column plus 1.
public static IEnumerable<T> RetrieveIdentity<T>(this IEnumerable<T> source, DataConnection context, bool useSequenceName = true, bool useIdentity = false) where T : notnull
Parameters
sourceIEnumerable<T>Ordered list of entities to initialize.
contextDataConnectionData connection to use to retrieve sequence values of max used value for column.
useSequenceNameboolEnables identity values retrieval from sequence for columns with sequence name specified in mapping using SequenceNameAttribute. Implemented for Oracle and PostgreSQL.
useIdentityboolEnables identity values retrieval from table with identity column. Implemented for SQL Server 2005+.
Returns
- IEnumerable<T>
Returns new collection of identity fields initialized or
sourceif entity had no identity columns.
Type Parameters
TEntity type.