예제 #1
0
 public async Task <IActionResult> Delete(Book bookDelete)
 {
     if (bookDelete != null)
     {
         await _iBooksRepository.DeleteBookAsync(bookDelete.Id);
     }
     return(RedirectToAction("Index"));
 }
예제 #2
0
        public async Task DeleteBookAsync(Guid bookId)
        {
            if (bookId == default(Guid))
            {
                throw new ArgumentException("Empty guid", nameof(bookId));
            }

            _logger.LogInformation($"Delete book {bookId}");

            var book = await _repository.DeleteBookAsync(bookId);

            _imagesService.DeleteImage(book);
        }