public void AddLapTime(VehicleLapTime lapTime) { if (!_lapTimes.Any(l => l.LapNumber == lapTime.LapNumber)) { _lapTimes.Add(lapTime); } }
public void AddLapTime(VehicleLapTime lapTime) { var vehicleLaps = _vehicleLapTimes.FirstOrDefault(v => v.CarNumber == lapTime.CarNumber); if (vehicleLaps == null) { vehicleLaps = new VehicleLapTimes(lapTime.CarNumber); _vehicleLapTimes.Add(vehicleLaps); } vehicleLaps.AddLapTime(lapTime); }