I am trying to get coordinates stored in the address model. I am using google maps api with the Chadly/Geocoding.net to get the coordinates but it requires async and I have never used async within a model and having problems getting it to work.
It is throwing me this error
"Cannot implicitly convert type 'Geocoding.Location' to '
System.Threading.Tasks.Task<Geocoding.Location>
'"
Anything special I have to do to get this to work?
public string FullAddress
{
get
{
return Address + " " + City + " " + State + "" + ZipCode;
}
}
public async Task<Geocoding.Location> Coordinates
{
get
{
IEnumerable<Address> addresses = await geocoder.GeocodeAsync(FullAddress);
return addresses.First().Coordinates;
}
}