Esempio n. 1
0
 public WeatherDataController(IEnumerable <IWeatherData> weatherDataServices, IWeatherInputParser inputParser,
                              MvcWeatherContext context, ISmhiApiServices smhiApiServices)
 {
     _weatherDataServices = weatherDataServices;
     _inputParser         = inputParser;
     _context             = context;
     _weatherData         = _inputParser.ParseWeatherInput();
     _smhiApiServices     = smhiApiServices;
 }
Esempio n. 2
0
        public string SetDataSource(string csvPath)
        {
            try
            {
                _inputParser.SetDataSource(csvPath);
                _weatherData = _inputParser.ParseWeatherInput();
            }
            catch (System.IO.FileNotFoundException)
            {
                return("Error, file not found. Enter a locally stored csv file.");
            }

            return("Success, weather data source changed to " + csvPath);
        }
Esempio n. 3
0
 public WeatherDataController(IEnumerable <IWeather> weatherServices, IWeatherInputParser inputParser)
 {
     _inputParser     = inputParser;
     _weatherServices = weatherServices;
     _weatherData     = _inputParser.ParseWeatherInput();
 }