public StopsController( IPassageService passageService, IAutocompleteService autocompleteService, IStopCacheService stopCacheService) { this.autocompleteService = autocompleteService; this.stopCacheService = stopCacheService; this.passageService = passageService; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, IStopCacheService stopCacheService) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { // 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.UseDefaultFiles(); app.UseSpaStaticFiles(); app.UseMvc(routes => { routes.MapRoute("default", "{controller}/{action=Index}"); routes.MapRoute("spa", "{*url}", new { controller = "Home", action = "Index" }); }); stopCacheService.InitStaticData().Wait(); }
public LocalAutocompleteService(IStopCacheService stopService) { this.stopService = stopService; }