public async Task UpdateAsync(ReaderModel model) { ReaderValidation.CheckReader(model); var reader = _mapper.Map <Reader>(model); _unit.ReaderRepository.Update(reader); await _unit.SaveAsync(); }
public async Task AddAsync(ReaderModel model) { ReaderValidation.CheckReader(model); var reader = _mapper.Map <Reader>(model); await _unit.ReaderRepository.AddAsync(reader); await _unit.SaveAsync(); model.Id = reader.Id; }