Add a field to PersonMap:
public class PersonMap : EntityTypeConfiguration<Person> { public string TableName { get { return "Persons"; } } public PersonMap() { ... this.ToTable(TableName); ... } }
Access to it:
var map = new PersonMap(); string table = map.TableName;
If you do not know the type of card, use the interface:
public interface IMap { string TableName { get; } } public class PersonMap : EntityTypeConfiguration<Person>, IMap { public string TableName { get { return "Persons"; } } public PersonMap() { ... this.ToTable(TableName); ... } }
Access to this:
IMap map = new PersonMap(); string table = map.TableName;
source share