Esempio n. 1
0
 public CitiesController(IOptionsMonitor <AppSettingsOptions> appSettings, IMapper mapper,
                         ICountryApiClient countryApiClient, IWeatherApiClient weatherApiClient, ICityRepository cityRepository)
 {
     _appSettings      = appSettings ?? throw new ArgumentNullException(nameof(appSettings));
     _mapper           = mapper ?? throw new ArgumentNullException(nameof(mapper));
     _countryApiClient = countryApiClient ?? throw new ArgumentNullException(nameof(countryApiClient));
     _weatherApiClient = weatherApiClient ?? throw new ArgumentNullException(nameof(weatherApiClient));
     _cityRepository   = cityRepository ?? throw new ArgumentNullException(nameof(cityRepository));
 }
Esempio n. 2
0
 public WeatherController(
     IWeatherApiClient apiClient,
     IMapper mapper,
     IHttpContextWrapper httpContextWrapper)
 {
     _apiClient          = apiClient;
     _mapper             = mapper;
     _httpContextWrapper = httpContextWrapper;
 }
Esempio n. 3
0
 public WeatherCacheService(
     IWeatherApiClient weatherApiClient,
     IDistributedCache <CurrentWeatherResult> cache,
     IOptionsMonitor <ExternalServicesConfig> options,
     ILogger <WeatherCacheService> logger)
 {
     _weatherApiClient         = weatherApiClient;
     _cache                    = cache;
     _logger                   = logger;
     _minutesToCache           = options.Get(ExternalServicesConfig.WeatherApi).MinsToCache;
     _refreshIntervalInSeconds = _minutesToCache > 1 ? (_minutesToCache - 1) * 60 : 30; // 1 minute before cache expires (or every 30 seconds)
 }
Esempio n. 4
0
        public AddViewModel(IMessenger messenger, IWeatherApiClient weatherApiClient, IForecastStorage forecastStorage)
        {
            this.messenger        = messenger;
            this.weatherApiClient = weatherApiClient;
            this.forecastStorage  = forecastStorage;

            this.messenger.Register <LocationMessage>(this, message =>
            {
                Longitude = message.Longitude.ToString();
                Latitude  = message.Latitude.ToString();
            });
        }
Esempio n. 5
0
 public WeatherController(IWeatherApiClient weatherApiClient)
 {
     _weatherApiClient = weatherApiClient;
 }
Esempio n. 6
0
 public WeatherService(IWeatherApiClient weatherApiClient, IReadableDateTimeService readableDateTimeService)
 {
     _readableDateTimeService = readableDateTimeService;
     _weatherApiClient        = weatherApiClient;
 }
Esempio n. 7
0
 public WeatherForecaster(IWeatherApiClient weatherApiClient)
 {
     _weatherApiClient = weatherApiClient;
 }
 public HeatingReminderHelper(ISettings settings, IWeatherApiClient weatherApiClient)
 {
     this.settings         = settings;
     this.weatherApiClient = weatherApiClient;
 }
Esempio n. 9
0
 public WeatherForecaster(IWeatherApiClient weatherApiClient, IOptions <WeatherForecastingConfiguration> options)
 {
     _weatherApiClient = weatherApiClient;
     ForecastEnabled   = options.Value?.EnableWeatherForecast ?? false;
 }
Esempio n. 10
0
 public WeatherService(IMapper mapper, IDbContext context, IWeatherApiClient apiClient)
 {
     _mapper    = mapper;
     _context   = context;
     _apiClient = apiClient;
 }
Esempio n. 11
0
 public TodoItemsController(TodoContext context, api.client.IWeatherApiClient weatherApiClient)
 {
     _context          = context;
     _weatherApiClient = weatherApiClient;
 }
Esempio n. 12
0
 public WeatherService(IWeatherApiClient client)
 {
     _client = client;
 }
Esempio n. 13
0
 public SearchViewModel(ILocationService <LocationInfo> locationService, IWeatherApiClient weatherApiClient) : base(locationService, weatherApiClient)
 {
     InitializeSearchViewModel();
 }
Esempio n. 14
0
 public WeatherService(AppDbContext context, IWeatherApiClient apiClient)
 {
     _context   = context;
     _apiClient = apiClient;
 }
Esempio n. 15
0
 public WeatherApiController(ILogger <PokemonController> logger)
 {
     _logger           = logger;
     _weatherApiClient = RestService.For <IWeatherApiClient>("http://api.openweathermap.org/");
 }