示例#1
0
 public CategoryController(
     IGetCategoryQuery getCategoryQuery,
     ISaveCategoryCommand saveCategoryCommand)
 {
     _getCategoryQuery    = getCategoryQuery;
     _saveCategoryCommand = saveCategoryCommand;
 }
 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;
 }
示例#3
0
 public IActionResult Get(int id, [FromServices] IGetCategoryQuery command)
 {
     return(Ok(_executor.ExecuteQuery(command, id)));
 }
示例#4
0
 public IActionResult Get(
     [FromQuery] CategorySearch search,
     [FromServices] IGetCategoryQuery query)
 {
     return(Ok(_executor.ExecuteQuery(query, search)));
 }