Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Name does not exist in this context
Message
 
 
Information générale
Forum:
ASP.NET
Catégorie:
MVC
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01560632
Message ID:
01560637
Vues:
42
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform