public BookConsumer( [FromServices] IGetBookCommand getBookCommand, [FromServices] IPostBookCommand postBookCommand, [FromServices] IPutBookCommand putBookCommand, [FromServices] IDeleteBookCommand deleteBookCommand) { _getBookCommand = getBookCommand; _postBookCommand = postBookCommand; _putBookCommand = putBookCommand; _deleteBookCommand = deleteBookCommand; }
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; }
public IActionResult Delete(int id, [FromServices] IDeleteBookCommand command) { _executor.ExecuteCommand(command, id); return(StatusCode(StatusCodes.Status204NoContent)); }