public EventNotificator(IOptions <AppSetting> _appSettings, UnitOfWork <ApplicationDbContext> _unit, VkApi _vkApi, AfishaData _afishaData) { Timeout = TimeSpan.FromSeconds(_appSettings.Value.AfishaBotSettings.EventNotificationLoopIntervalInSec); p_afishaData = _afishaData; p_unit = _unit; p_vkApi = _vkApi; }
public HomeController(IHostingEnvironment environment, IHttpContextAccessor accessor, IMemoryCache memoryCache, IOptions <AppSetting> appSettings, VkApi vkApi, UnitOfWork <ApplicationDbContext> unit, AfishaData afisha) : base(environment, accessor, memoryCache) { Unit = unit; AppSettings = appSettings; Api = vkApi; Afisha = afisha; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, IOptions <AppSetting> _appSetting, AfishaData _data, AfishaBot _afishaBot) { if (env.IsDevelopment()) { _afishaBot.Start(BotTaskType.NotificationAboutEvent); app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(); app.UseBrowserLink(); } else { _afishaBot.Start(BotTaskType.NotificationAboutEvent); //app.UseExceptionHandler("/Home/Error"); app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(); } app.UseRequestLocalization(new RequestLocalizationOptions { DefaultRequestCulture = new RequestCulture(new CultureInfo("ru")), SupportedCultures = new List <CultureInfo> { new CultureInfo("ru") }, SupportedUICultures = new List <CultureInfo> { new CultureInfo("ru") } }); app.UseStaticFiles(); //app.UseErrorHandler(); app.UseSession(); //обновляем миграции if (env.IsProduction()) { app.UseMigrations(); } app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); routes.MapRoute(name: "areaRoute", template: "{area:exists}/{controller=Home}/{action=Index}"); }); }