public static void CheckUserWaypointsForGeocache(Framework.Data.UserWaypointCollection wpCollection, string geocacheCode, List<int> validUserWaypointIds) { List<Framework.Data.UserWaypoint> curList = (from Framework.Data.UserWaypoint w in wpCollection where w.GeocacheCode == geocacheCode select w).ToList(); foreach (var wp in curList) { if (!validUserWaypointIds.Contains(wp.ID)) { wpCollection.Remove(wp); } } }