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