Open
Description
This is to follow up on #47023 (comment) and #47023 (comment)
Currently, you have to construct a RazorComponentResult manually, e.g.:
// Minimal
endpoints.Map("/mypage", () => new RazorComponentResult<MyPageComponent>());
// MVC
public IResult MyPage()
=> new RazorComponentResult<MyPageComponent>(new { Greeting = "Hmm" });
For consistency with other built-in result types, we probably also want helpers so you can do things like:
// Minimal
endpoints.Map("/mypage", () => Results.RazorComponent<MyPageComponent>());
// MVC
public IResult MyPage()
=> RazorComponent<MyPageComponent>(new { Greeting = "Hmm" });