示例#1
0
        public IActionResult GetProducts(
            [FromServices] GetProductsByCategoryName getProductsByCategoryName,
            string name)
        {
            var products = getProductsByCategoryName.Do(name);

            return(Ok(products));
        }
示例#2
0
 public void OnGet(
     [FromServices] GetProductsByCategoryName getProductsByCategoryName,
     [FromServices] GetCategory getCategory,
     string name)
 {
     Products = getProductsByCategoryName.Do(name);
     Category = getCategory.Do(name);
 }