public ScriptCreatorService(ILogger <ScriptCreatorService> logger, IRuntimeCompilerService compiler, ApplicationPartManager apm, IServiceCollection services, IAssemblyLocator assemblyLocator) { _logger = logger; _compiler = compiler; _services = services; _apm = apm; _locator = assemblyLocator as ScribiAssemblyLocator; }
/// <summary> /// Constructor with injection /// </summary> /// <param name="rumtimeCompiler"></param> public MappingService(IRuntimeCompilerService rumtimeCompiler, ILogger <MappingService> logger) { _logger = logger; _rumtimeCompiler = rumtimeCompiler; _client.OnConnectionChange += _client_OnConnectionChange; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IMappingService mappingService, IRuntimeCompilerService runtimeCompilerService, IAuthenticationService authService, IRelayService relayService ) { var globalConfig = Configuration.GetSection("Global"); loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); if (globalConfig.GetValue("UseLogFiles", true)) { loggerFactory.AddNLog(); env.ConfigureNLog("nlog.config"); // <- Throws ArgumentNullException in productive environment //LogManager.Configuration = new XmlLoggingConfiguration("nlog.config", true); // <- Workaround for ArgumentNullException } runtimeCompilerService.Configure(Configuration.GetSection("RuntimeCompiler")); runtimeCompilerService.Init(); mappingService.Configure(Configuration.GetSection("Plc")); mappingService.Init(); authService.Configure(Configuration.GetSection("Auth")); authService.Init(); app.UseWebPackAuth(); app.UseCors(options => { options.AllowAnyHeader(); options.AllowAnyMethod(); options.AllowAnyOrigin(); options.AllowCredentials(); }); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } if (globalConfig.GetValue("UseSignalR", true)) { relayService.Init(); if (globalConfig.GetValue("UseWebSockets", true)) { app.UseWebSockets(); } app.UseSignalR(); } app.UseMvc(); //Not supported at the moment if (globalConfig.GetValue("UseSwagger", true)) { app.UseSwagger(); app.UseSwaggerUi(); } }