Example #1
0
 public BookConsumer(
     [FromServices] IGetBookCommand getBookCommand,
     [FromServices] IPostBookCommand postBookCommand,
     [FromServices] IPutBookCommand putBookCommand,
     [FromServices] IDeleteBookCommand deleteBookCommand)
 {
     _getBookCommand    = getBookCommand;
     _postBookCommand   = postBookCommand;
     _putBookCommand    = putBookCommand;
     _deleteBookCommand = deleteBookCommand;
 }
Example #2
0
 public BooksService(IAddBookCommand addBookCommand,
                     IUpdateBookCommand updateBookCommand,
                     IDeleteBookCommand deleteBookCommand,
                     IGetBookQuery getBookQuery,
                     IListAllBooksQuery listBooksQuery,
                     IStringLocalizer <BooksService> localiser)
 {
     _addBookCommand    = addBookCommand;
     _updateBookCommand = updateBookCommand;
     _deleteBookCommand = deleteBookCommand;
     _getBookQuery      = getBookQuery;
     _listBooksQuery    = listBooksQuery;
     _localiser         = localiser;
 }
Example #3
0
 public IActionResult Delete(int id,
                             [FromServices] IDeleteBookCommand command)
 {
     _executor.ExecuteCommand(command, id);
     return(StatusCode(StatusCodes.Status204NoContent));
 }