public IActionResult OnGet(
     [FromServices] GetCategory getCategory,
     string name)
 {
     Category = getCategory.Action(name.Replace("-", " "));
     if (Category == null)
     {
         return(RedirectToPage("/Index"));
     }
     else
     {
         return(Page());
     }
 }
Beispiel #2
0
 public IActionResult GetCategory(
     int id,
     [FromServices] GetCategory getCategory) =>
 Ok(getCategory.Action(id));