Skip to content

Instantly share code, notes, and snippets.

@valeriob
Last active August 31, 2017 07:51
Show Gist options
  • Save valeriob/5676bef2fe41c7c47f7c48212de4148a to your computer and use it in GitHub Desktop.
Save valeriob/5676bef2fe41c7c47f7c48212de4148a to your computer and use it in GitHub Desktop.
@inherits R4Mvc.R4MvcBasedRazorPage<TModel>
<h2>Index</h2>
<div>
Test Url DI :@Url.Action(MVCTest.Dummy)
</div>
public abstract class R4MvcBasedRazorPage<TModel> : RazorPage<TModel>
{
[RazorInject]
public MVCHelperBase MVCTest { get; set; }
}
public void ConfigureServices(IServiceCollection services)
{
services.AddR4Mvc(/* Hook to add model unbinders */);
}
public static class Extensons{
public static void AddR4mvc(IServiceCollection services){
services.AddTransient<R4Mvc.MVCHelperBase>();
// find a way to replace extend RazorPage<TModel>
// maybe with RazorViewEngineOptions.CompilationCallback
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment