Esempio n. 1
0
 /// <summary>Adds to application builder the registered OWIN middle-wares
 /// wrapped in <see cref="DryIocWrapperMiddleware{TServiceMiddleware}"/>.</summary>
 /// <param name="app">App builder to use.</param>
 /// <param name="registry">Container registry to find registered <see cref="OwinMiddleware"/>.</param>
 /// <returns>App builder to enable method chaining.</returns>
 public static IAppBuilder UseRegisteredMiddlewares(this IAppBuilder app, IRegistrator registry)
 {
     foreach (var middlewareType in registry.DiscoverRegisteredMiddlewares())
     {
         app = app.Use(middlewareType);
     }
     return(app);
 }