public TEntity Update(TEntity entity) { try { if (entity == null) { throw new ArgumentNullException("entity"); } _dbContext.SetAsUpdated(entity); return(entity); } catch (DbEntityValidationException dbEx) { throwException(dbEx); return(null); } }