feat: CUID & fix: reorder bug

This commit is contained in:
2026-03-02 16:34:18 +01:00
parent 9b261dbf78
commit f0d51bc85e
5 changed files with 275 additions and 152 deletions

View File

@@ -1,4 +1,5 @@
using System;
using CarManagerV3.Util;
namespace CarManagerV3
{
@@ -115,12 +116,15 @@ namespace CarManagerV3
int numericId = 0;
if ((string.IsNullOrWhiteSpace(id) || int.TryParse(id, out numericId)) && id != "0")
{
id = Guid.NewGuid().ToString();
id = CUID.NewCUID().ToString();
if (numericId > 0)
{
order = numericId + order;
}
}
if(id.Length > 8)
{
id = CUID.NewCUID().ToString();
}
// Sets the properties using the setters to ensure validation is applied.
this.id = id;