public static bool IsMvcRazorPage(this ActionContext actionContext) => actionContext.GetActionDescriptorType() == ActionDescriptorType.MvcRazorPage;
public static bool IsMvcController(this ActionContext actionContext) => actionContext.GetActionDescriptorType() == ActionDescriptorType.MvcController;