Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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));
            }
        }
Esempio n. 3
0
        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));
            }
        }