Here\'s my situation: I have been working on an ASP.NET MVC 3 application for a while. It has a database (built out of a db project; I\'m going db-first) for which I have an edm
Got it! Horrible, horrible experience...
In short: EF cannot correctly pluralize entity names that end with "s" (e.g. "status", "campus", etc.)
Here's how I got it and proof.
TransStatus
and the like - no luck.sheep
and goose
. This got me thinking "what if he problem is in the actual name of the entity?"status
in particular and found this report of the problem on Connect. I rushed to try renaming my entity...TransactionStatuses
to TransactionStates
(while even keeping the columns as StatusID
) fixed the issue! I can now get List statuses = db.TransactionStates.ToList();
status
in the name... But after vocally complaining about this to a friend I was suggested that maybe the problem is with the word ending with "s"... So I decided to check it out.Campuses
and matching POCO Campus
(and updated the edmx). Did the simple test List test = db.Campuses.ToList();
and got the now expected Invalid object name 'dbo.Campus'.
So there you go, the mighty EF cannot handle pluralization of words ending with "s". Hopefully, the next poor bugger hitting the problem will find this question and save him- or herself 3-4 hours of pain and frustration.