Exemplo n.º 1
0
 public static void UseNHibernateHandler(this IAppBuilder appBuilder, NHibernateOwinHandler handler)
 {
     appBuilder.Use(async(context, func) =>
     {
         handler.BeforeRequest(context);
         await func();
         handler.AfterRequest(context);
     });
 }
Exemplo n.º 2
0
 public WebApiStartup(HttpConfiguration httpConfiguration, NHibernateOwinHandler hibernateOwinHandler,
                      MetricsMiddleware metricsMiddleware, IWebApiConfig webApiConfig)
 {
     _httpConfiguration    = httpConfiguration;
     _hibernateOwinHandler = hibernateOwinHandler;
     _metricsMiddleware    = metricsMiddleware;
     _webApiConfig         = webApiConfig;
     ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, errors) => true;
 }