我的上下文中有多个约定。他们互相覆盖。有没有办法读回之前设置的表名?
如果首先阅读此惯例......
public class FirstConvention : Convention
{
public FirstConvention()
{
this.Types()
.Configure(t =>
{
t.ToTable("First_" + t.ClrType.Name);
});
}
}
...然后运行这个约定....
public class SecondConvention : Convention
{
public SecondConvention()
{
this.Types()
.Configure(t =>
{
// is it possible to check here if the tablename is set earlier?
t.ToTable(t.ClrType.Name + "_second");
});
}
}
......来自第一个公约的表名被覆盖了。有没有办法在第二个约定中读取表名?