예제 #1
0
 public HttpClientProvider(
     IOptions <YrConfig> yrOptions,
     IOptions <RuterConfig> ruterOptions
     )
 {
     _yrConfig = yrOptions.Value;
 }
예제 #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))
     });
 }
예제 #3
0
 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
     });
 }