public void Add(Vehicle Vehicle) { Vehicles.OrderBy(x => x.ID); int FreeID = 1; foreach (var Veh in Vehicles) { if (Veh.ID > FreeID) { break; } FreeID = Veh.ID + 1; } Vehicle.ID = FreeID; Vehicles.Add(Vehicle); }
public void Remove(Vehicle Vehicle) { Vehicles.Remove(Vehicle); }