public void GetWorldTemperaturesWithMapper(WeatherInfoViewModel viewModel) { Weather_Request request = new Weather_Request() { City = viewModel.CityFilter }; CallService <WeatherInfoViewModel, Weather_Request, Weather_Response, WeatherServiceClient>(viewModel, (c, req) => c.WeatherInfo(req)); }
public Weather_Response WeatherInfo(Weather_Request request) { Weather_Response response = new Weather_Response(); string htmlContents = weatherReader.Download(configManager.GetAppSetting("WorldWeatherUrl") + "weather/"); response.locations = htmlScraper.GetCities(htmlContents); request.City = request.City ?? string.Empty; response.locations = response.locations.Where(l => l.City.Contains(request.City)).ToList(); return(response); }
public WeatherInfoViewModel GetWorldTemperatures(WeatherInfoViewModel viewModel) { var weatherInfoViewModel = new WeatherInfoViewModel(); var request = new Weather_Request() { City = viewModel.CityFilter }; var worldTemperaturesResponse = GetResponseFromServiceCall <Weather_Request, Weather_Response, WeatherServiceClient>(request, (c, req) => c.GetWorldTemperaturesSoap(req)); var mapper = new WeatherInfoMapper(); mapper.Map(worldTemperaturesResponse, weatherInfoViewModel); //var dummyRequest = new Dummy_Request(); //var dummyResponse = GetResponseFromServiceCall<Dummy_Request, Dummy_Response, DummyServiceClient>(dummyRequest, (c, req) => c.GetData(dummyRequest)); return(weatherInfoViewModel); }