public async Task UpdateAsync(BookModel model) { BookValidation.CheckBook(model); var book = _mapper.Map <Book>(model); _unit.BookRepository.Update(book); await _unit.SaveAsync(); }
public async Task AddAsync(BookModel model) { BookValidation.CheckBook(model); var book = _mapper.Map <Book>(model); await _unit.BookRepository.AddAsync(book); await _unit.SaveAsync(); model.Id = book.Id; }