This commit is contained in:
2026-07-27 14:29:46 +08:00
110 changed files with 13942 additions and 2044 deletions
+14
View File
@@ -868,6 +868,20 @@ public sealed class WmsService
entity.GetType().Name, entity.Id, version);
}
private static bool IsUniqueConstraintViolation(DbUpdateException ex)
{
for (Exception? e = ex; e != null; e = e.InnerException)
{
var msg = e.Message;
if (msg.Contains("UNIQUE constraint failed", StringComparison.OrdinalIgnoreCase)
|| msg.Contains("unique index", StringComparison.OrdinalIgnoreCase)
|| msg.Contains("duplicate key", StringComparison.OrdinalIgnoreCase))
return true;
}
return false;
}
private static void EnsureUnlocked(EntityBase entity)
{
if (entity.IsLock)