private static LatLong? ParseUserLocation(string location)
{
if (string.IsNullOrWhiteSpace(location))
{
return null;
}
var locationPieces = location.Split(',');
if (locationPieces.Length != 2)
{
throw new FormatException("2 comma-separated numbers must be provided in the location string.");
}
return new LatLong(double.Parse(locationPieces[0]),
double.Parse(locationPieces[1]));
}