Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Name does not exist in this context
Message
 
General information
Forum:
ASP.NET
Category:
MVC
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01560632
Message ID:
01560637
Views:
41
>Hi everybody,
>
>In my ClientRepository class I am trying to add this method
>
>
>public void UpdateClient(Client client, bool autoCommit = true)
>        {
>            this.context.Entry(client).State = EntityState.Modified;
>            if (autoCommit) this.Commit();
>        }
>
>However, I am getting EntityState underlined with red and saying name "EntityState" does not exist in this content. I have "using System.Data" declaration at the very top and I've checked that this enumeration exists in System.Data namespace.
>
>What I am doing wrong?
>
>Thanks in advance.

Ok, after I built the project, the error became apparent - it wanted System.Data.Entity in the references.

Now, I also have warnings in this line
  <input type="number" id=@ViewData.ModelMetadata.PropertyName name=@ViewData.ModelMetadata.PropertyName class="numericOnly" value=@Model  />
Warning 1 Validation (HTML5): This attribute requires a value. If the value is enclosed in quotation marks, the quotation marks must match.

Is there more elegant way to write the above to not have this warning?
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform