public ProductController(IGetProductQuery getProductQuery, IGetRelatedProductQuery getRelatedProductQuery, IGetProductDetailQuery getProductDetailQuery, IGetRateQuery getRateQuery, IGetCommentQuery getCommentQuery, IGetCategoryQuery getCategoryQuery, ICreateCommentCommand createCommentCommand, ICreateRateCommand createRateCommand, IUpdateCommentCommand updateCommentCommand, IDeleteCommentCommand deleteCommentCommand) { this.getProductQuery = getProductQuery; this.getRelatedProductQuery = getRelatedProductQuery; this.getProductDetailQuery = getProductDetailQuery; this.getRateQuery = getRateQuery; this.getCommentQuery = getCommentQuery; this.getCategoryQuery = getCategoryQuery; this.createCommentCommand = createCommentCommand; this.createRateCommand = createRateCommand; this.updateCommentCommand = updateCommentCommand; this.deleteCommentCommand = deleteCommentCommand; }
public IActionResult Get( [FromQuery] ProductSearch search, [FromServices] IGetProductQuery query) { return(Ok(executor.ExecuteQuery(query, search))); }
public IActionResult Get(int id, [FromServices] IGetProductQuery query) { return(Ok(_executor.ExecuteQuery(query, id))); }