1
使用EntityFramework 4.3 w/POCOs。 如何檢查模型上的屬性是否被忽略?檢查某個屬性是否被EntityFramework忽略
在我的DbContext類層次結構,我通過
modelBuilder.Entity<EClass>().Ignore (f => f.IgnoredProperty());
忽略的屬性在我BaseContext類,我需要檢查如果屬性被忽略或沒有。
private void ProcessGlobalConvention(DbModelBuilder modelBuilder, IGlobalConvention convention)
{
modelBuilder.Entity<typeof(this.GetType())>("Ignored Property");
}
我該怎麼做?
感謝
是的,我需要一個代碼解決方案。我可以找出[NotMapped]屬性,但是當您使用模型構建器忽略列時,我無法檢測到該屬性。 – hazimdikenli 2013-12-09 13:16:41