public int Update(T entity) { using (var dbContext = new WebContextDataBase()) { dbContext.Entry(entity).State = EntityState.Modified; return(dbContext.SaveChanges()); } }
public int Delete(T entity) { using (var dbContext = new WebContextDataBase()) { dbContext.Entry(entity).State = EntityState.Deleted; return(dbContext.SaveChanges()); } throw new NotImplementedException(); }