In ASP.NET MVC 4/5, I used to create my custom WebViewPage to add some methods that I can access from my razor view with a shorter, concise syntax as the following example
public abstract class CustomWebViewPage<TModel> : WebViewPage<TModel>
{
public string T(string translationKey)
{
return Html.Translate(translationKey);
}
}
In the Razor page, I can use @T instead of @Html.Translate
@T("/path1/path2")
However, in ASP.NET Core 6, I tried to create my custom razor page type (see 2nd screenshot) and found RazorPage type doesn't expose HtmlHelper property, therefore I'm unable to access the inner HtmlHelper like how I did in in traditional ASP.NET MVC 4/5 (see 1st screenshot).
Can someone point me to the right direction?
Thanks

