c# - Entity Framework stopped working -


i have project has been working fine long time. when tried debug project today said couldn't find entity framework. thought weird tried installing latest version of entity framework. when loads following error, never had before:

invalid object name 'dbo.events'.

there no table in database called events. occurs when hits following code:

mymodel mmcontext = new mymodel(); datetime comparedate = new datetime(datetime.now.year, datetime.now.month, datetime.now.day); list<event> evs = mmcontext.events.where(e => e.listid == 1 && e.enddate >= comparedate).orderby(e => e.startdate).tolist(); 

which should use following model:

public class mymodel : dbcontext {     public mymodel()         : base("myconnection")     { }      public dbset<event> events { get; set; } }  [table("eventcatalog_events")] public class event {     [key]     [databasegeneratedattribute(databasegeneratedoption.identity)]     public int eventid { get; set; }     etc... } 

i'm @ loss why it's started doing or how fix it. ideas?

managed projects working again doing repair on visual studio. still not sure caused problem.

update turns out problem entity framework 6. apparently no longer supports [table("table_name")] data annotation due being purely code first. once rolled entity framework 5.0.0 started working again.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -