Beispiel #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(
            IApplicationBuilder app,
            IHostingEnvironment env,
            IApplicationLifetime lifetime,
            IServiceProvider container,
            IOptionsSnapshot <SchedulerSettings> options)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseStaticFiles();
            app.UseCookiePolicy();

            app.UseMvc(routes => routes.MapRoute(
                           "default",
                           "{controller=Home}/{action=Index}/{id?}"));

            var quartz = new QuartzStartup(options, container);

            lifetime.ApplicationStarted.Register(quartz.Start);
            lifetime.ApplicationStopped.Register(quartz.Stop);
        }
 public TaskPlanController(ILogger <TaskPlanController> logger, SqlLiteContext SqlLiteContext, QuartzStartup quartzStartup, FreeSqlFactory freeSqlFactory)
 {
     _SqlLiteContext = SqlLiteContext;
     _logger         = logger;
     _quartzStartup  = quartzStartup;
     _sqliteFSql     = freeSqlFactory.GetBaseSqlLite();
 }
Beispiel #3
0
        public static void Initialize(string connectionString,
                                      IExecutionContextAccessor executionContextAccessor,
                                      ILogger logger,
                                      EmailsConfiguration emailsConfiguration,
                                      string textEncryptionKey,
                                      IEmailSender emailSender,
                                      IEventsBus eventsBus,
                                      bool runQuartz = true)
        {
            var moduleLogger = logger.ForContext("Module", "Matches");

            ConfigureCompositionRoot(connectionString,
                                     executionContextAccessor,
                                     logger,
                                     emailsConfiguration,
                                     textEncryptionKey,
                                     eventsBus,
                                     emailSender,
                                     runQuartz);

            if (runQuartz)
            {
                QuartzStartup.Initialize(moduleLogger);
            }

            EventsBusStartup.Initialize(moduleLogger);
        }
Beispiel #4
0
        // 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,
            IApplicationLifetime lifetime)
        {
            var quartz = new QuartzStartup();

            lifetime.ApplicationStarted.Register(quartz.Start(1));

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            //app.UseMvcWithDefaultRoute();
            app.UseCors("AllowAll");
            app.UseSignalR(s => s.MapHub <ChartHub>("/chart"));
            app.UseMvc();
        }
 public HomeController(ILogger <HomeController> logger, SqlLiteContext SqlLiteContext, QuartzStartup quartzStartup)
 {
     //LogProvider.SetCurrentLogProvider(new AutoSchedule.Common.LogProvider());
     _SqlLiteContext = SqlLiteContext;
     _logger         = logger;
     _quartzStartup  = quartzStartup;
 }
Beispiel #6
0
        public static void Initialize(string connectionString, ILogger logger, IEmailSender emailSender)
        {
            var moduleLogger = logger.ForContext("Module", "Customers");

            ConfigureCompositionRoot(connectionString, moduleLogger, emailSender);
            QuartzStartup.Start(moduleLogger);
        }
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, IServiceProvider iServiceProvider, IApplicationLifetime lifetime)
        {
            _quartzStartup = app.ApplicationServices.GetService <QuartzStartup>();
            lifetime.ApplicationStarted.Register(_quartzStartup.Start);
            lifetime.ApplicationStopping.Register(_quartzStartup.Stop);
            app.ApplicationServices.GetService <IScheduler>();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseStaticFiles();
            app.UseCookiePolicy();

            app.UseAuthentication();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });

            Seed.CreateRoles(iServiceProvider, Configuration).Wait();
        }
Beispiel #8
0
        public void Configure(IApplicationBuilder app,
                              IHostingEnvironment env,
                              IApplicationLifetime appLifeTime,
                              ILoggerFactory loggerFactory)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            loggerFactory.AddFile("Logs/RemoteCam-{Date}.log");

            app.UseCors("CorsPolicy");

            var quartzConfig = new QuartzStartup(app);

            appLifeTime.ApplicationStarted.Register(quartzConfig.Start);
            appLifeTime.ApplicationStopping.Register(quartzConfig.Stop);

            app.UseMvc();

            app.UseSignalR(routes =>
            {
                routes.MapHub <CamHub>("/cam");
            });
        }
Beispiel #9
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, IServiceProvider container)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseStaticFiles();
            app.UseCookiePolicy();

            QuartzStartup.Start(container);
        }
Beispiel #10
0
        public static void Initialize(
            string connectionString,
            IExecutionContextAccessor executionContextAccessor,
            ILogger logger)
        {
            var moduleLogger = logger.ForContext("Module", "Payments");

            ConfigureCompositionRoot(connectionString, executionContextAccessor, moduleLogger);

            QuartzStartup.Initialize(moduleLogger);

            EventsBusStartup.Initialize(moduleLogger);
        }
        public static void Initialize(
            string connectionString,
            IExecutionContextAccessor executionContextAccessor,
            ILogger logger,
            IEventsBus eventsBus)
        {
            var moduleLogger = logger.ForContext("Module", "Administration");

            ConfigureContainer(connectionString, executionContextAccessor, moduleLogger, eventsBus);

            QuartzStartup.Initialize(moduleLogger);

            EventsBusStartup.Initialize(moduleLogger);
        }
Beispiel #12
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure
            (IApplicationBuilder app, IHostingEnvironment env, IApplicationLifetime lifetime,
            IServiceProvider serviceProvider)
        {
            app.UseMvc();
            var loggerFactory = serviceProvider.GetRequiredService <ILoggerFactory>();

            //configure NLog
            loggerFactory.AddNLog();
            loggerFactory.ConfigureNLog(Path.Combine(env.ContentRootPath, @"NLog.config"));

            var quartz = new QuartzStartup(serviceProvider);

            lifetime.ApplicationStarted.Register(quartz.Start);
            lifetime.ApplicationStopping.Register(quartz.Stop);
        }
Beispiel #13
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, IApplicationLifetime life)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }

            var quartz = new QuartzStartup();

            life.ApplicationStarted.Register(quartz.Start);
            app.UseHttpsRedirection();
            app.UseMvc();
        }
        public static void Initialize(string connectionString,
                                      IExecutionContextAccessor executionContextAccessor,
                                      ILogger logger,
                                      EmailsConfiguration emailsConfiguration,
                                      string textEncryptionKey)
        {
            var moduleLogger = logger.ForContext("Module", "UserAccess");

            ConfigureCompositionRoot(connectionString,
                                     executionContextAccessor,
                                     logger,
                                     emailsConfiguration,
                                     textEncryptionKey);

            QuartzStartup.Initialize(moduleLogger);

            EventsBusStartup.Initialize(moduleLogger);
        }
Beispiel #15
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, IApplicationLifetime lifetime)
        {
            // the following 3 lines hook QuartzStartup into web host lifecycle
            var quartz = new QuartzStartup();

            lifetime.ApplicationStarted.Register(quartz.Start);
            lifetime.ApplicationStopping.Register(quartz.Stop);

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseStaticFiles();
            app.UseSpaStaticFiles();
            app.UseCors(x => x.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller}/{action=Index}/{id?}");
            });

            app.UseSpa(spa =>
            {
                // To learn more about options for serving an Angular SPA from ASP.NET Core,
                // see https://go.microsoft.com/fwlink/?linkid=864501

                spa.Options.SourcePath = "ClientApp";

                if (env.IsDevelopment())
                {
                    spa.UseAngularCliServer(npmScript: "start");
                }
            });
        }
        public static void Initialize(
            string connectionString,
            IExecutionContextAccessor executionContextAccessor,
            ILogger logger,
            EmailsConfiguration emailsConfiguration,
            IEventsBus eventsBus)
        {
            var moduleLogger = logger.ForContext("Module", "Meetings");

            ConfigureCompositionRoot(
                connectionString,
                executionContextAccessor,
                moduleLogger,
                emailsConfiguration,
                eventsBus);

            QuartzStartup.Initialize(moduleLogger);

            EventsBusStartup.Initialize(moduleLogger);
        }
Beispiel #17
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app,
                              IHostingEnvironment env,
                              IApplicationLifetime lifetime,
                              IOptions <List <ProviderConfig> > providerConfigs)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseSwagger();

            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "Rates API V1");
            });

            app.UseMvc();

            var quartz = new QuartzStartup(_services.BuildServiceProvider(), providerConfigs);

            lifetime.ApplicationStarted.Register(quartz.Start);
            lifetime.ApplicationStopping.Register(quartz.Stop);
        }
 public static void Stop()
 {
     QuartzStartup.StopQuartz();
 }
 public static void Stop()
 {
     _subscriptionsManager.Stop();
     QuartzStartup.StopQuartz();
 }
Beispiel #20
0
 public ChartController(IHubContext <ChartHub> hub, ApplicationContext applicationContext)
 {
     _hub           = hub;
     _quartzStartup = new QuartzStartup();
     _emailService  = new EmailService(applicationContext);
 }