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); }
public DbRESTFulServiceMiddleware(RequestDelegate next, ConfiguredApiFilter filter) { this.next = next; this.filter = filter; }