Example #1
0
        public async Task Update(CreateUpdateBookDto input, Guid id)
        {
            var book = _bookRepository
                       .Where(p => p.Id == id).FirstOrDefault();

            book.Name        = input.Name;
            book.Type        = input.Type;
            book.PublishDate = input.PublishDate;
            book.Price       = input.Price;

            await _bookRepository.UpdateAsync(book);
        }
Example #2
0
        public async Task Create(CreateUpdateBookDto input)
        {
            var book = new Book(GuidGenerator.Create(), input.Name, input.Type, input.PublishDate, input.Price);

            await _bookRepository.InsertAsync(book);
        }