As reported in this github issue in CTP3, this cannot be done through configuration. However, you can replace the default MvcRazorHost with a custom one:
public abstract class MyPage<T> : RazorPage<T>
{/*...*/}
public abstract class MyPage : RazorPage
{/*...*/}
public class MvcMyHost : MvcRazorHost
{
public MvcMyHost() : base(typeof(MyPage).FullName) { }
}
public class Startup
{
public void Configure(IBuilder app)
{
var configuration = new Configuration();
configuration.AddJsonFile("config.json");
configuration.AddEnvironmentVariables();
app.UseServices(services =>
{
services.AddMvc(configuration);
services.AddTransient<IMvcRazorHost, MvcMyHost>();
});
// etc...
}
}
Unfortunately, you do not get intellisense with this approach, since the editor always uses the original MvcRazorHost class.
alpha4 vNext , ( - @inherits , , ) _ViewStart.cshtml, .