public void Update(TEntity entity) { db.Entry(entity).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); }