Exemple #1
0
        public async Task <IActionResult> Index()
        {
            WeatherAtLocationViewModel userWeather = new WeatherAtLocationViewModel();

            string ip = Request.HttpContext.Connection.RemoteIpAddress.MapToIPv4().ToString();

            ip = "68.186.11.102";

            LocationModel userLocation = await LocationModel.FindLocationFromIP(ip, client);

            WeatherModel locationWeather = await WeatherModel.FindWeatherFromLocation(userLocation.City, client);

            userWeather.location = userLocation;
            userWeather.weather  = locationWeather;

            return(View(userWeather));
        }