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(int id, [FromServices] IGetCommentQuery query) { return(Ok(_executor.ExecuteQuery(query, id))); }
public IActionResult GetComment([FromQuery] CommentSearch search, [FromServices] IGetCommentQuery query) { return(Ok(executor.ExecuteQuery(query, search))); }