Exemplo n.º 1
0
        // 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>();
        }
Exemplo n.º 2
0
 public SmhiStationsDownloader(ExternalEndpoints endpoints)
 {
     _endpoints = endpoints;
 }
Exemplo n.º 3
0
 public SmhiImporter(ExternalEndpoints endpoints)
 {
     _endpoints = endpoints;
 }