public RequestRunner( SystemHttpClient client, ITransmissionSettings transmissionSettings, IArrayFormatter arrayFormatter, CookieContainer cookieContainer, MiddlewareCollection middleware) { var defaultMiddleware = new RequestMiddleware(client, transmissionSettings, arrayFormatter, cookieContainer); middleware.Append(defaultMiddleware); middlewareHead = middleware.BuildMiddlewareChain(); }
public void Initialize() { IServiceCollection serviceCollection = CreateServiceCollection(); ConfigureServices(serviceCollection); serviceCollection.AddSingleton(serviceCollection); serviceCollection.AddTransient <ICommandModelFactory, CommandModelFactory>(); serviceCollection.AddTransient <ICommandViewFactory, CommandViewFactory>(); ServiceProvider = serviceCollection.BuildServiceProvider(); commands = CreateCommands() ?? new CommandPool(); serviceCollection.AddSingleton(commands); middlewareCollection = ServiceProvider.GetService <MiddlewareCollection>(); applicationHeader = CreateApplicationHeader(); applicationFooter = CreateApplicationFooter(); }
public static MiddlewareCollection UseExceptionHandler(this MiddlewareCollection builder) { return(builder.UseMiddleware <ExceptionHandlerMiddleware>()); }
public static MiddlewareCollection UseUselessMiddleware(this MiddlewareCollection builder) { return(builder.UseMiddleware <UselessMiddleware>()); }
public static MiddlewareCollection UseCommands(this MiddlewareCollection builder) { return(builder.UseMiddleware <CommandMiddleware>()); }