public void UpdatePerson(Person person) { using (var ctx = new ExampleDbContext()) { ctx.People.Attach(person); ctx.Entry(person).State = EntityState.Modified; ctx.SaveChanges(); } }
public virtual void Update(T entity) { dbSet.Attach(entity); dataContext.Entry(entity).State = EntityState.Modified; }