public PrerenderMiddleware(RequestDelegate next, PrerenderConfiguration configuration)
 {
     _next         = next;
     Configuration = configuration;
 }
Example #2
0
 /// <summary>
 /// Use Prerender Middleware to prerender JavaScript logic before turn back.
 /// </summary>
 /// <param name="app"></param>
 /// <param name="configuration">Prerender Configuration, if this parameter is NULL, will get the PrerenderConfiguration from ServiceCollection</param>
 /// <returns></returns>
 public static IApplicationBuilder UsePrerender(this IApplicationBuilder app, PrerenderConfiguration configuration = null)
 => app.UseMiddleware <PrerenderMiddleware>(configuration ?? app.ApplicationServices.GetService <IOptions <PrerenderConfiguration> >().Value);