// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddDbContext <WeatherContext>(options => options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"))); services.AddMvc(); var settings = new ExternalEndpoints(); Configuration.Bind("ExternalEndpoints", settings); services.AddSingleton(settings); services.AddScoped <IWeatherImporter, SmhiImporter>(); services.AddScoped <IWeatherStationRepository, WeatherStationRepository>(); services.AddScoped <ITemperatureRepository, TemperatureRepository>(); }
public SmhiStationsDownloader(ExternalEndpoints endpoints) { _endpoints = endpoints; }
public SmhiImporter(ExternalEndpoints endpoints) { _endpoints = endpoints; }