简体   繁体   English

表类从EntityFramework的DBcontext对象中消失

[英]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. 我仍然面对这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将手动DbSet添加到局部类DbContext EntityFramework - Add manual DbSet to Partial class DbContext EntityFramework 从EntityFramework的`DbContext`中获取数据库类型 - Get the database type from EntityFramework's `DbContext` 您可以从 EntityFramework Core 中的另一个 DbContext 创建一个子 DbContext 吗? - Can you create a sub DbContext from another DbContext in EntityFramework Core? 如何在 EntityFramework Core 中使用部分类和部分 OnModelCreating 方法扩展 DbContext - How to extend DbContext with partial class and partial OnModelCreating method in EntityFramework Core 使用EntityFramework dbContext在另一个表中获取带有count的记录 - Using EntityFramework dbContext to get records with count in another table 如何清空EntityFramework DbContext? - How to empty an EntityFramework DbContext? 使用ASP.NET MVC和EntityFramework从DbContext中排除列 - Exclude a column from DbContext using ASP.NET MVC and EntityFramework EntityFramework DBContext审核中的错误 - Error in EntityFramework DBContext Audit EntityFramework从表中检索信息 - EntityFramework retrieving information from a table 从DbContext访问Moq Mock数据两次调用时消失了吗? - Accessing Moq Mock Data from DbContext disappears when called twice?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM