コード例 #1
0
        public async Task UpdateAsync(ReaderModel model)
        {
            ReaderValidation.CheckReader(model);

            var reader = _mapper.Map <Reader>(model);

            _unit.ReaderRepository.Update(reader);
            await _unit.SaveAsync();
        }
コード例 #2
0
        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;
        }