예제 #1
0
 /// <summary>
 /// Added the middlware that creates and disposes a <see cref="IRenderEngine"/> for each request
 /// </summary>
 /// <param name="app">The application.</param>
 public static void UseJsEngine(
     this AppBuilder app
     #if !DOTNETCORE
     , IRenderEngineFactory renderEngineFactory
     #endif
     )
 {
     #if !DOTNETCORE
     app.Use <RenderEngineMiddleware>(renderEngineFactory);
     #else
     app.UseMiddleware <RenderEngineMiddleware>();
     #endif
 }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RenderEngineMiddleware"/> class.
 /// </summary>
 /// <param name="next">The next.</param>
 /// <param name="renderEngineFactory">The render engine factory.</param>
 public RenderEngineMiddleware(RequestDelegate next,
                               IRenderEngineFactory renderEngineFactory)
 {
     _next = next;
     _renderEngineFactory = renderEngineFactory;
 }
예제 #3
0
 public MvcApplication()
 {
     _renderEngineFactor = new SingletonRenderEngineFactory(new NodeRenderEngineBuilder(null, new Options <NodeRenderEngineOptions>(new NodeRenderEngineOptions())));
     BeginRequest       += OnBeginRequest;
     EndRequest         += OnEndRequest;
 }