feat: reordering
This commit is contained in:
@@ -119,6 +119,17 @@ namespace CarManagerV3
|
||||
filePath = path;
|
||||
}
|
||||
|
||||
public static List<Car> normalizeOrders(List<Car> cars)
|
||||
{
|
||||
// Normalize the Order field of all cars to be sequential starting from 1, while keeping the relative order the same.
|
||||
var orderedCars = cars.OrderBy(c => c.Order).ToList();
|
||||
for (int i = 0; i < orderedCars.Count; i++)
|
||||
{
|
||||
orderedCars[i].Order = i + 1;
|
||||
}
|
||||
return orderedCars;
|
||||
}
|
||||
|
||||
public static bool askForMigration()
|
||||
{
|
||||
if (hasConfirmedMigration)
|
||||
|
||||
Reference in New Issue
Block a user