コード例 #1
0
 public CategoryController(
     GetAllCategoriesQuery getAllCategoriesQuery,
     GetProductsByCategoryQuery getProductsByCategoryQuery)
 {
     GetAllCategoriesQuery      = getAllCategoriesQuery;
     GetProductsByCategoryQuery = getProductsByCategoryQuery;
 }
コード例 #2
0
        public async Task <IActionResult> GetProductsByCategory([FromQuery] GetProductsByCategoryQuery query)
        {
            var result = await _mediatr.Send(query);

            if (result is NotFoundResponse)
            {
                return(NotFound());
            }

            return(Ok(result));
        }