/// <summary>
 /// Initializes a new instance of the <see cref="SaveProblemDtoRequestHandler"/> class.
 /// </summary>
 /// <param name="mappingHelper">The mapping helper.</param>
 /// <param name="problemFactory">The problem factory.</param>
 public SaveProblemDtoRequestHandler(
     IDtoToDomainMappingHelper mappingHelper,
     IProblemFactory problemFactory)
 {
     _mappingHelper  = mappingHelper;
     _problemFactory = problemFactory;
 }
Example #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, IProblemFactory problemFactory)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseCors(builder =>
            {
                builder
                .AllowAnyOrigin()
                .AllowAnyMethod()
                .AllowAnyHeader()
                .WithExposedHeaders("Location");
            });

            app.UseRouting();
            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });

            // unknown route
            app.Run(async context =>
            {
                var problem = problemFactory.NotFound();
                context.Response.ContentType = DefaultMediaTypes.ProblemJson;
                context.Response.StatusCode  = problem.StatusCode;
                await context.Response.WriteAsync(JsonConvert.SerializeObject(problem));
            });
        }
 /// <summary>
 /// Construtor
 /// </summary>
 /// <param name="trainedModel">Trained model</param>
 public SvmTesting(Model trainedModel, IProblemFactory problemFactory)
 {
     Guard.NotNull(() => trainedModel, trainedModel);
     Guard.NotNull(() => problemFactory, problemFactory);
     this.trainedModel   = trainedModel;
     this.problemFactory = problemFactory;
 }
 public RobotBlueprintController(
     DesignCommandHandler commandHandler,
     IProblemFactory problemFactory)
 {
     CommandHandler = commandHandler;
     ProblemFactory = problemFactory;
 }
Example #5
0
 public ParametersSelectionFactory(TaskFactory taskFactory, IProblemFactory problemFactory)
 {
     Guard.NotNull(() => taskFactory, taskFactory);
     Guard.NotNull(() => problemFactory, problemFactory);
     this.taskFactory    = taskFactory;
     this.problemFactory = problemFactory;
 }
 public ProductionLineController(
     GetByIdCommandHandler getByIdCommandHandler,
     ShutDownForMaintenanceCommandHandler shutDownForMaintenanceCommandHandler,
     CompleteMaintenanceCommandHandler completeMaintenanceCommandHandler,
     IProblemFactory problemFactory)
 {
     GetByIdCommandHandler = getByIdCommandHandler;
     ShutDownForMaintenanceCommandHandler = shutDownForMaintenanceCommandHandler;
     CompleteMaintenanceCommandHandler    = completeMaintenanceCommandHandler;
     ProblemFactory = problemFactory;
 }
 public SvmTraining(IProblemFactory problemFactory, IArffDataSet dataSet)
 {
     Guard.NotNull(() => problemFactory, problemFactory);
     Guard.NotNull(() => dataSet, dataSet);
     this.problemFactory = problemFactory;
     this.dataSet        = dataSet;
     if (dataSet.RandomSeed == null)
     {
         dataSet.RandomSeed = Environment.TickCount;
     }
 }
Example #8
0
        public GlobalExceptionFilter(IServiceCollection serviceCollection)
        {
            var serviceProvider = serviceCollection.BuildServiceProvider();

            var loggerFactory = serviceProvider.GetService <ILoggerFactory>();

            if (loggerFactory != null)
            {
                Logger = loggerFactory.CreateLogger("Global Exception Filter");
            }

            ProblemFactory = serviceProvider.GetService <IProblemFactory>();
            if (ProblemFactory == null)
            {
                throw new Exception("Could not get problem factory for global exception handler.");
            }
        }
Example #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ImportC32RequestHandler"/> class.
 /// </summary>
 /// <param name="mappingHelper">The mapping helper.</param>
 /// <param name="patientDocumentRepository">The patient document repository.</param>
 /// <param name="provenanceFactory">The provenance factory.</param>
 /// <param name="clinicalCaseRepository">The clinical case repository.</param>
 /// <param name="problemFactory">The problem factory.</param>
 /// <param name="immunizationFactory">The immunization factory.</param>
 /// <param name="labSpecimenFactory">The lab specimen factory.</param>
 /// <param name="vitalSignFactory">The vital sign factory.</param>
 public ImportC32RequestHandler(
     IDtoToDomainMappingHelper mappingHelper,
     IPatientDocumentRepository patientDocumentRepository,
     IProvenanceFactory provenanceFactory,
     IClinicalCaseRepository clinicalCaseRepository,
     IProblemFactory problemFactory,
     IImmunizationFactory immunizationFactory,
     ILabSpecimenFactory labSpecimenFactory,
     IVitalSignFactory vitalSignFactory
     )
 {
     _mappingHelper             = mappingHelper;
     _patientDocumentRepository = patientDocumentRepository;
     _provenanceFactory         = provenanceFactory;
     _clinicalCaseRepository    = clinicalCaseRepository;
     _problemFactory            = problemFactory;
     _immunizationFactory       = immunizationFactory;
     _labSpecimenFactory        = labSpecimenFactory;
     _vitalSignFactory          = vitalSignFactory;
 }
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IProblemFactory problemFactory, IDriver driver, IHostApplicationLifetime hostApplicationLifetime)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseCors(builder =>
            {
                builder
                .WithOrigins(new string[] { "http://localhost:8080", "https://mathiasreichardt.github.io", "https://hypermedia.marcel-weigel.de" })
                //.AllowAnyOrigin()
                .AllowAnyMethod()
                .AllowAnyHeader()
                .AllowCredentials()
                .WithExposedHeaders("Location");
            }
                        );

            app.UseRouting();
            app.UseDefaultFiles();
            app.UseStaticFiles();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
                endpoints.MapHub <SensorHub>("/hub");
            });

            app.Run(async context =>
            {
                var problem = problemFactory.NotFound();
                context.Response.ContentType = DefaultMediaTypes.ProblemJson;
                context.Response.StatusCode  = problem.StatusCode;
                await context.Response.WriteAsync(JsonConvert.SerializeObject(problem));
            });

            driver.Init();

            hostApplicationLifetime.ApplicationStopping.Register(OnShutdown);
        }
 public GiphyController(IGiphyServices giphyServices, IProblemFactory problemFactory)
 {
     _giphyServices  = giphyServices;
     _problemFactory = problemFactory;
 }
Example #12
0
 public DesignController(DesignCommandHandler commandHandler, IProblemFactory problemFactory)
 {
     ProblemFactory = problemFactory;
     CommandHandler = commandHandler;
 }
Example #13
0
 public ProductionController(ProductionCommandHandler commandHandler, IProblemFactory problemFactory)
 {
     ProblemFactory = problemFactory;
     CommandHandler = commandHandler;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DeleteProblemRequestHandler"/> class.
 /// </summary>
 /// <param name="problemRepository">The problem repository.</param>
 /// <param name="problemFactory">The problem factory.</param>
 public DeleteProblemRequestHandler(
     IProblemRepository problemRepository, IProblemFactory problemFactory)
 {
     _problemRepository = problemRepository;
     _problemFactory    = problemFactory;
 }
 public CodeforcesMiner(IWebClient webClient, IAttempter attempter, IProblemFactory problemFactory)
 {
     this.webClient = webClient;
     this.attempter = attempter;
     this.problemFactory = problemFactory;
 }