var context = new BiContext();
var entityType = context.Model.FindEntityType(typeof(InvoiceDetail));
var tableName = entityType.GetTableName();
Console.WriteLine(tableName);
var properties = entityType.GetProperties();
# Property Name in Class
foreach (var p in properties)
{
Console.WriteLine(p.Name);
}
# Column Name in Table
foreach (var p in properties)
{
Console.WriteLine(p.GetColumnName());
}
References
https://stackoverflow.com/questions/45667126/how-to-get-table-name-of-mapped-entity-in-entity-framework-core
Related