コード例 #1
0
        public static IApplicationBuilder UseMicroServiceContainer(this IApplicationBuilder app, IConfigurationRoot configuration,
                                                                   IApiAuthorizeFilter authorizeFilter)
        {
            var loggerFactory = app.ApplicationServices.GetRequiredService <ILoggerFactory>();
            var logger        = loggerFactory.CreateLogger("DbRESTFulAPI");

            app.UseServiceContainer(configuration, loggerFactory);

            LoggerManager.Use(logger);
            var apiFilter = new ConfiguredApiFilter
            {
                ApiAuthorizeFilter     = authorizeFilter,
                ResponseResultResolver = new DefaultResponseResultResolver()
            };

            app.UseMiddleware <DbRESTFulServiceMiddleware>(apiFilter);

            return(app);
        }
コード例 #2
0
 public DbRESTFulServiceMiddleware(RequestDelegate next, ConfiguredApiFilter filter)
 {
     this.next   = next;
     this.filter = filter;
 }