我正在尝试使用现有表测试Entity Framework CTP 5 Code First。
EdmMetadata
表。Trusted_Connection=true;Persist Security Info=True
。
System.NotSupportedException was unhandled by user code
Message=Model compatibility cannot be checked because the database does not contain model metadata.
Source=EntityFramework
如何在没有EdmMetadata
表的情况下运行此应用程序?
答案 0 :(得分:6)
如果您不想使用EdmMetadata表,请尝试将其添加到DbContext
派生类中:
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Conventions.Remove<IncludeMetadataConvention>();
}