Просмотр исходного кода

Fixed comparer function in ImportFactory

Kenric Nugteren 1 год назад
Родитель
Сommit
8e36ba57ea
1 измененных файлов с 8 добавлено и 3 удалено
  1. 8 3
      InABox.Core/Imports/ImportFactory.cs

+ 8 - 3
InABox.Core/Imports/ImportFactory.cs

@@ -59,15 +59,20 @@ namespace InABox.Core
             var props = DatabaseSchema.Properties(type)
                 .OrderBy(x => x.Page, Comparer<string>.Create((x, y) =>
                 {
-                    if(x.IsNullOrWhiteSpace() || x.Equals("General"))
+                    var result = x.CompareTo(y);
+                    if(result == 0)
+                    {
+                        return 0;
+                    }
+                    else if(x.Equals(""))
                     {
                         return -1;
                     }
-                    else if(y.IsNullOrWhiteSpace() || y.Equals("General"))
+                    else if(y.Equals(""))
                     {
                         return 1;
                     }
-                    return x.CompareTo(y);
+                    return result;
                 }))
                 .ThenBy(x => CoreUtils.GetPropertySequence(x));