public async Task Execute(Cities inputTo, IRespondWithSuccessOrError <int, ErrorOutput> presenter) { //Todo: Is this correct? //Todo: Is there a different way of doing this? var cityCode = await _country.Fetch_City_Code(inputTo.City, inputTo.State, inputTo.Country); presenter.Respond(cityCode); }
public async Task Execute(Cities inputTo, IRespondWithSuccessOrError <Cities, ErrorOutput> presenter) { try { var city = await _country.Fetch_City_Code(inputTo.City, inputTo.State, inputTo.Country); presenter.Respond(city); } catch (Exception ex) { presenter.Respond(new ErrorOutput(ex.Message)); } }
public async Task Execute(Cities inputTo, IRespondWithSuccessOrError <CurrentWeather, ErrorOutput> presenter) { try { var city = await _country.Fetch_City_Code(inputTo.City, inputTo.State, inputTo.Country); var currentWeather = await _weather.Fetch_Weather_For_Today(city.CityId); presenter.Respond(currentWeather); } catch (Exception ex) { presenter.Respond(new ErrorOutput(ex.Message)); } }