public void Delete(int id, [FromServices] IDeleteProductCommand command) { _executor.ExecuteCommand(command, id); }
public ProductsController(IGetProductsCommand getCommand, IGetProductCommand getOneCommand, IAddProductCommand addProductCommand, IDeleteProductCommand deleteProductCommand, IUpdateProductCommand updateProductCommand) { _getCommand = getCommand; _getOneCommand = getOneCommand; _addCommand = addProductCommand; _deleteCommand = deleteProductCommand; _updateCommand = updateProductCommand; }
public IActionResult Delete(int id, [FromServices] IDeleteProductCommand command) { _executor.ExecuteCommand(command, id); return(StatusCode(StatusCodes.Status204NoContent)); }