コード例 #1
0
 public WeatherViewModel(WeatherQueryResponse weatherData, IViewFacade viewFacade, WeatherCodeService weatherCodeService, WeatherRecommendationService evaluationService)
 {
     WeatherData           = weatherData;
     ViewFacade            = viewFacade;
     WeatherCodeService    = weatherCodeService;
     RecommendationService = evaluationService;
 }
コード例 #2
0
 /// <summary>
 /// The entry point method.
 /// </summary>
 /// <param name="args">The command line arguments.</param>
 /// <returns></returns>
 static async Task Main(string[] args) => await new ConsoleApplication().RunAsync <Options>(args,
                                                                                            async options =>
 {
     var weatherData     = await new WeatherStackService().QueryCurrentAsync(options.Location);
     var recommondations = new WeatherRecommendationService().Get(weatherData);
     foreach (var recommondation in recommondations)
     {
         Console.WriteLine(recommondation.Question);
         Console.WriteLine(recommondation.Answer ? "yes" : "no");
     }
     return(0);
 });