public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IServiceProvider services, OperationPipeline pipelineBuilder, IContractRegistry contracts) { app.UseStaticFiles(); app.ConfigureExceptionHandler(); app.UseRouting(); app.UseMiddleware <CookieIdentificationMiddleware>(); app.UseEndpoints(endpoints => { endpoints.MapPost("/api/operations/{title}", services.GetService <OperationRequestHandler>().InvokeAsync); endpoints.MapControllerRoute("Default", "/api/{controller}/{action=Index}"); }); foreach (var startup in _startups) { startup.Configure(pipelineBuilder, contracts, services); } pipelineBuilder.Build(); if (Log.IsEnabled(Serilog.Events.LogEventLevel.Information)) { Log.Information("Registered operations: {0}", string.Join(", ", contracts.OperationContracts.Keys)); Log.Information("Registered events: {0}", string.Join(", ", contracts.EventContracts.Keys)); Log.Information("Registered data types: {0}", string.Join(", ", contracts.DataContracts.Keys)); } }
public void Configure(IOperationPipelineBuilder pipeline, IContractRegistry contracts, IServiceProvider services) { // Контракты операций, событий и данных автоматически регистрируются из контракта сервиса contracts.RegisterServiceContract <ISubDemoPlugin>(); // Дополняется конвейер обработки операций pipeline .AddPipe <HrPipe>() .AddPipe <SubOfTheDayPipe>() .AddPipe <OrderCounterPipe>() .AddPipe <KitchenPipe>(); }
public ContractsController(IContractRegistry contracts) { _contracts = contracts; }
public void Configure(IOperationPipelineBuilder pipeline, IContractRegistry contracts, IServiceProvider services) { contracts.RegisterServiceContract <IMotionPlugin>(); pipeline.AddPipe <OdometryPipe>(); }
public OperationRequestHandler(IContractRegistry contracts, OperationPipeline pipeline) { _contracts = contracts; _pipeline = pipeline; }