Beispiel #1
0
 public static EventLocation From(GoogleAPI.RootObject ro)
 {
     return(new EventLocation {
         FormattedAddress = ro.Results?[0]?.formatted_address,
         Lat = ro.Results?[0]?.geometry?.location?.lat ?? 0,
         Lng = ro.Results?[0]?.geometry?.location?.lng ?? 0
     });
 }
Beispiel #2
0
    public async Task <IActionResult> Search(string address)
    {
        GoogleAPI.RootObject data = await gs.Get(address);

        return(Ok(EventLocation.From(data)));
    }