Created
February 12, 2017 19:29
-
-
Save mabuenox/0991a2f3c506b495a6c96f9a2995582c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DistanceCalculator | |
{ | |
public int CalculateDistanceInKm(string origin, string destination) | |
{ | |
if (string.IsNullOrEmpty(origin) | |
{ | |
throw new ArgumentNullException("You tried to provide a null or empty origin; please supply a valid city name"); | |
} | |
if (string.IsNullOrEmpty(destination) | |
{ | |
throw new ArgumentNullException("You tried to provide a null or empty destination; please supply a valid city name"); | |
} | |
return GoogleMaps.DistanceMatrix.Query(origin, destination); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment