Method GetColumnName
GetColumnName<TEntity>(DbContext, Expression<Func<TEntity, object>>)
Resolves the column name from the entity model based on the property selector.
public static string GetColumnName<TEntity>(this DbContext dbContext, Expression<Func<TEntity, object>> columnSelector) where TEntity : class
Parameters
dbContext
DbContextThe DbContext instance.
columnSelector
Expression<Func<TEntity, object>>An expression selecting the column.
Returns
- string
The database column name.
Type Parameters
TEntity
GetColumnName<TEntity>(DbContext, string)
public static string GetColumnName<TEntity>(this DbContext dbContext, string propertyName) where TEntity : class
Parameters
Returns
Type Parameters
TEntity