public OptimizeRouteCriteria(string startAddress, string endAddress, List<OptimizeRouteWaypoint> waypoints)
{
if (string.IsNullOrWhiteSpace(startAddress))
{
throw new ArgumentException(nameof(startAddress));
}
if (string.IsNullOrWhiteSpace(endAddress))
{
throw new ArgumentException(nameof(endAddress));
}
if (waypoints == null || !waypoints.Any())
{
throw new ArgumentException(nameof(waypoints));
}
// Ensure that all string values are URL encoded
StartAddress = UrlEncoder.Default.Encode(startAddress);
EndAddress = UrlEncoder.Default.Encode(endAddress);
Waypoints = waypoints;
}