EntitySet could not be found
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
精彩评论