public virtual async Task <bool> Update(TEntity entity) { try { DbSet.Attach(entity); _context.Entry(entity).State = EntityState.Modified; return(await Task.FromResult(true)); } catch (Exception) { return(await Task.FromResult(false)); } }
public virtual void Update(T entity) { _dbContext.Entry(entity).CurrentValues.SetValues(entity); }
public Task Update <T>(T entity) where T : Entity { _dbContext.Entry(entity).State = EntityState.Modified; return(_dbContext.SaveChangesAsync()); }