[英]Table Class disappears from DBcontext object of EntityFramework
I have updated my edmx file for the changes done in database. 我已经针对数据库中所做的更改更新了edmx文件。
The Database diagram shows the newly added table(RelyingParty). 数据库图显示了新添加的表(RelyingParty)。 Using DBContext object i am trying to perform operation in it at my DAL layer, But the table class keeps disappearing/missing from the code.
我试图使用DBContext对象在我的DAL层中执行操作,但是表类不断从代码中消失/丢失。
Initially it was present and after some time it says - ' RelyingPart is not part of the model for the currentcontext ' 最初它是存在的,过了一会儿它说-'RelyingPart不是当前上下文模型的一部分 '
What i tried? 我尝试了什么?
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<RelyingParty>().ToTable("RelyingParty");
}
In Entites.Context.cs class. 在Entites.Context.cs类中。 Still i am facing the issue.
我仍然面对这个问题。
这是由于edmx文件未正确更新而造成的。如何:在数据库更改时更新.edmx文件(实体数据模型工具)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.