0
私は_Layout.cshtml
にビューコンポーネントを持っています。私のアプリケーションのルートは/home/{id}
です。 View Component ControllerからURLルートのid
値を取得するにはどうすればよいですか?.NET CoreのView Componentコントローラからルート値を取得するにはどうすればよいですか?
public class LayoutViewComponent : ViewComponent
{
public async Task<IViewComponentResult> InvokeAsync()
{
//how do I get the value of {id} here?
return View();
}
}