示例#1
0
        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));
        }
示例#2
0
        public async Task <DelayBllModel> AddAsync(int delayOrder)
        {
            var newDelay = new DelayBllModel();
            await _unitOfWork.DelayRepository.AddAsync(_mapper.Map <Delay>(newDelay));

            await _unitOfWork.SaveChangesAsync();

            return(newDelay);
        }
示例#3
0
        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();
        }