Пример #1
0
        public async Task <IActionResult> Index()
        {
            string clientIpAddress = HttpContext.GetIpAddress();

            ListOfPlacesViewModels listOfPlaces = await Execute(() => _skyscannerService.Location.GetPlaceByIpAddress(clientIpAddress));

            ListOfCountriesViewModels listOfCountries = await Execute(() => _skyscannerService.Location.GetListOfCountries());


            return(View((listOfCountries, listOfPlaces)));
        }
Пример #2
0
        public async Task <ListOfPlacesViewModels> GetPlaceByIpAddress(
            string ipAddress,
            string country  = "UK",
            string currency = "GBP",
            string locale   = "en-GB")
        {
            ListOfPlaces listOfPlaces = await _skyscannerProvider.GetPlaceByIpAddress(ipAddress, country, currency, locale);

            ListOfPlacesViewModels listOfPlaceViewModels = _skyscannerMapper.MapListOfPlacesToListOfPlacesViewModel(listOfPlaces);

            return(listOfPlaceViewModels);
        }
Пример #3
0
        public async Task <ListOfPlacesViewModels> GetPlaceByIpAddress(
            string ipAddress,
            string country  = "UK",
            string currency = "GBP",
            string locale   = "en-GB")
        {
            ListOfPlaces listOfPlaces = await FileHelper.GetDataAsync <ListOfPlaces>(FileName.PARENT_FOLDER, FileName.PLACE_IP_80_73_11_139);

            ListOfPlacesViewModels listOfPlaceViewModels = _skyscannerMapper.MapListOfPlacesToListOfPlacesViewModel(listOfPlaces);

            return(listOfPlaceViewModels);
        }