Method GetKeys
GetKeys<T>(DbContext, T)
Gets the primary keys for the specified entity.
public static PrimaryKeys<T> GetKeys<T>(this DbContext ctx, T entity) where T : class
Parameters
ctx
DbContextThe DbContext instance.
entity
TThe entity.
Returns
- PrimaryKeys<T>
The primary keys as a PrimaryKeys instance.
Type Parameters
T
The type of the entity.
GetKeys<T>(DbContext, List<T>)
Gets the primary keys for the specified entities.
public static List<PrimaryKeys<T>> GetKeys<T>(this DbContext ctx, List<T> entities) where T : class
Parameters
Returns
- List<PrimaryKeys<T>>
The primary keys as a list of PrimaryKeys instances.
Type Parameters
T
The type of the entity.