public async Task <bool> UpdateAsync(Unit unitToUpdate, CancellationToken cancellationToken) { _dataContext.Units.Update(unitToUpdate); var updated = await _dataContext.SaveChangesAsync(cancellationToken); return(updated > 0); }
public async Task <bool> UpdateAsync(Position entityToUpdate, CancellationToken cancellationToken) { _dataContext.Positions.Update(entityToUpdate); var updated = await _dataContext.SaveChangesAsync(cancellationToken); return(updated > 0); }
public async Task <bool> AddAsync(DepartmentAddModel department) { await _dataContext .Departments .AddAsync ( _mapper .Map <DataEntities.Department>(department) ); await _dataContext.SaveChangesAsync(); return(true); }
public async Task <bool> SaveAllChangesAsync() { return(await _context.SaveChangesAsync() > 0); }