Пример #1
0
 public void Update(T entity)
 {
     _dbContext.Set <T>().Attach(entity);
     _dbContext.Entry(entity).State = EntityState.Modified;
 }
Пример #2
0
 public Repository(InfoHubContext dbContext)
 {
     _dbContext = dbContext ?? throw new ArgumentNullException("dbContext can not be null.");
     _dbSet     = dbContext.Set <T>();
 }