The name 'EntityState' does not exist in the current context

Try changing

e.g.

System.Data.EntityState.Modified;

to

System.Data.Entity.EntityState.Modified;

(Not sure what's going on. Did Microsoft change the package?)


When I had this problem, I fixed it by including the namespace it's from:

using System.Data;

More info:

http://msdn.microsoft.com/en-us/library/system.data.entitystate.aspx


I fixed this issue as below

Namespace

using System.Data;
using System.Data.Entity;

I was working earlier in ASP.Net MVC C# application working fine for me. I fixed this issue as below

using System.Data;

I was working earlier in ASP.Net MVC C# application working fine for me

_context.Entry(_Teach).State = System.Data.EntityState.Modified;

Now, same method using in simple c#, WCF but it giving me issue then I did this in a way as below:

_context.Entry(_Teach).State = EntityState.Modified;

I fixed this problem by including the namespace it's from:

using System.Data.Entity;