Hi,
I am trying to use the new Xamarin Essentials Geocoding from this doc:
The code looks like this:
var location = await Geolocation.GetLocationAsync();
latitude = location.Latitude;
longitude = location.Longitude;
var placemarks = await Geocoding.GetPlacemarksAsync(latitude, longitude);
var placemark = placemarks?.FirstOrDefault();
await DisplayAlert("latitude", Convert.ToString(latitude), "Ok");
await DisplayAlert("longitude", Convert.ToString(longitude), "Ok");
await DisplayAlert("country", placemark.CountryCode, "Ok");
but I am getting this error:
**Error CS1061: 'IEnumerable' does not contain a definition for 'FirstOrDefault' and no extension method 'FirstOrDefault' accepting a first argument of type 'IEnumerable' could be found (are you missing a using directive or an assembly reference?) (CS1061)
**
Thanks,
Jassim