What use instead Entry?

edited November 2016
var person = Persons.Where(p => p.Age == 12).FirstOrDefault(); Entry(person).State = EntityState.Modified; person.Name = "Josh"; SubmitChanges();

And i have error : CS0103 The name 'Entry' does not exist in the current context


  • This is syntactically wrong, you need more brackets:

    (Entry(person)).State = EntityState.Modified;

    This will work, assuming 'Entry' exists. (Entry is not part of LINQ to SQL, are you using Entity Framework or something else?)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!