开发者

EntitySet could not be found

开发者 https://www.devze.com 2023-02-05 21:27 出处:网络
I\'m working on an MVC site using EF4 as my data source. I\'ve had no problem开发者_运维技巧s with other projects with EF4 until today. I\'m getting an error stating EntitySet name Entities.Sites coul

I'm working on an MVC site using EF4 as my data source. I've had no problem开发者_运维技巧s with other projects with EF4 until today. I'm getting an error stating EntitySet name Entities.Sites could not be found. I have another EDMX file for another dataset that is set up nearly the same (with different entity names) and it works fine when I try to run a LINQ query against it.

My EDMX has 2 tables (site and page) with a 1 to many association from the site to page table. Everything compiles fine, but in runtime, it's almost like the datamodel fails on every property list population. I do have Lazy Loading enabled (It's a .NET 4 project).

I stepped through the code on the designer class and it fails when it gets to a call like this

if((_Pages == null))
{
     _Pages = base.CreateObjectSet<Page>("Pages");
}

I have not altered the code in the designer.cs. I'm at a major wall with this. Any ideas what I could be doing wrong?


Try renaming your entity Page to something else, like EntityPage (for example) to see if this resolved it. As stated by @Yakimych this could simply be a case of Namespace clashing

0

精彩评论

暂无评论...
验证码 换一张
取 消