Ejemplo n.º 1
0
        public async Task <IActionResult> Delete(int id)
        {
            var book = await service.GetSingleAsync(id);

            if (book is null)
            {
                return(NotFound());
            }

            await service.DeleteBookAsync(id);

            return(Ok());
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Delete(Guid id)
        {
            await _booksService.DeleteBookAsync(id);

            return(Ok());
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> DeleteBook(int bookId)
        {
            var result = await _booksService.DeleteBookAsync(bookId);

            return(Ok(result));
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> DeleteBookAsync(string bookId)
        {
            var result = await _booksService.DeleteBookAsync(bookId);

            return(result.IsSuccess ? Ok(result.Value) : MapError(result.Error));
        }
Ejemplo n.º 5
0
        public override async Task OnDeleteCoreAsync()
        {
            await _booksService.DeleteBookAsync(this.Item);

            _eventAggregator.GetEvent <RefreshBooksEvent>().Publish();
        }