This is probably a really easy one… but after 4 days off from work my brain isn’t functiuoning correctly. I’m using Entity Framework to model my DB. When I call my context none of my entites appear and the only thing I get is a call to ValidateObject().
My code looks like this
using (var dc = new FLMAEntities())
{
dc. (Only thing I get is ValidateObject)
}
I’m also getting an error that the data context can not be converted to IDisposable which I know it can. I thought it was going to be a connection string issue but the edmx file is using the correct connection string and hasn’t added an extra 1 at the end or somethignfunky like that.. any ideas people ?
Have you tried to regenerated the Entities? Are you using Model First, Database First approach? Try and change something on the designer and let them regenerate for you the entities class. You can use the T4 templates and try if that works. I usually use SelfTrack template, it’s nice, handy and it works good.
are you calling the Entities from another project? If yes, might be System.Data.Entity as the comments above mention.
If it does not work…I would recommend to delete all your tables and add them again. Depends on the approach of course.