public IActionResult GetProducts( [FromServices] GetProductsByCategoryName getProductsByCategoryName, string name) { var products = getProductsByCategoryName.Do(name); return(Ok(products)); }
public void OnGet( [FromServices] GetProductsByCategoryName getProductsByCategoryName, [FromServices] GetCategory getCategory, string name) { Products = getProductsByCategoryName.Do(name); Category = getCategory.Do(name); }