public HttpClientProvider(
     IOptions <YrConfig> yrOptions,
     IOptions <RuterConfig> ruterOptions
     )
 {
     _yrConfig = yrOptions.Value;
 }
Exemple #2
0
 public static SimpleYrModel FromApiModel(YrApiModel model, YrConfig config)
 {
     return(new SimpleYrModel
     {
         LastUpdated = model.Weatherdata.Meta.LastUpdate,
         SunRise = model.Weatherdata.Sun.Rise,
         SunDown = model.Weatherdata.Sun.Set,
         ForecastData = model.Weatherdata.Forecast.Tabular.Time.Take(4).Select(m => ForecastEntryModel.FromModel(m, config))
     });
 }
 internal static ForecastEntryModel FromModel(ForecastTimePeriodModel model, YrConfig config)
 {
     return(new ForecastEntryModel
     {
         From = model.From,
         To = model.To,
         SymbolId = model.Symbol.NumberEx,
         SymbolDescription = model.Symbol.Name,
         PrecipitationInMillimeters = model.Precipitation.Value,
         WindSpeedInMetersPerSecond = model.WindSpeed.Mps,
         TemperaturesInCelcius = model.Temperature.Value
     });
 }