public bool Edit(T entity) { context.Entry(entity).State = EntityState.Modified; int i = context.SaveChanges();//how many rows will be effected return(i > 0); }