Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created March 4, 2025 21:32
Show Gist options
  • Save dcomartin/255bebe734b8ccfc9e8b7d8ef0f5ba27 to your computer and use it in GitHub Desktop.
Save dcomartin/255bebe734b8ccfc9e8b7d8ef0f5ba27 to your computer and use it in GitHub Desktop.
public double ShipmentDistance(ExternalShipment shipment)
{
var miles = shipment.Stops.Sum(x => x.Miles);
return miles * 1.60934;
}
public double TollDistance(ExternalShipment shipment)
{
var miles = shipment.Stops
.Where(x => x.HasTolls)
.Sum(x => x.Miles);
return miles * 1.60934;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment