public async Task <DelayBllModel> AddAsync(DelayBllModel delay) { var newDelay = _mapper.Map <Delay>(delay); await _unitOfWork.DelayRepository.AddAsync(newDelay); await _unitOfWork.SaveChangesAsync(); return(_mapper.Map <DelayBllModel>(newDelay)); }
public async Task <DelayBllModel> AddAsync(int delayOrder) { var newDelay = new DelayBllModel(); await _unitOfWork.DelayRepository.AddAsync(_mapper.Map <Delay>(newDelay)); await _unitOfWork.SaveChangesAsync(); return(newDelay); }
public async Task UpdateAsync(int id, DelayBllModel delay) { var entity = await _unitOfWork.DelayRepository.FindAsyncDefault(s => s.Id == id); if (entity == null) { return; } entity.Date = delay.Date; entity.DelayOrder = delay.DelayOrder; _unitOfWork.DelayRepository.Update(entity); await _unitOfWork.SaveChangesAsync(); }