public async Task <IActionResult> Delete(Book bookDelete) { if (bookDelete != null) { await _iBooksRepository.DeleteBookAsync(bookDelete.Id); } return(RedirectToAction("Index")); }
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); }