Equal() static private méthode

static private Equal ( TableFieldInfo a, TableFieldInfo b ) : bool
a TableFieldInfo
b TableFieldInfo
Résultat bool
Exemple #1
0
 internal static bool Equal(TableVersionInfo a, TableVersionInfo b)
 {
     if (a.FieldCount != b.FieldCount)
     {
         return(false);
     }
     for (int i = 0; i < a.FieldCount; i++)
     {
         if (!TableFieldInfo.Equal(a[i], b[i]))
         {
             return(false);
         }
     }
     return(true);
 }
 internal static bool Equal(RelationVersionInfo a, RelationVersionInfo b)
 {
     //PKs
     if (a._primaryKeyFields.Count != b._primaryKeyFields.Count)
     {
         return(false);
     }
     for (int i = 0; i < a._primaryKeyFields.Count; i++)
     {
         if (!TableFieldInfo.Equal(a._primaryKeyFields[i], b._primaryKeyFields[i]))
         {
             return(false);
         }
     }
     //SKs
     if (a._secondaryKeys.Count != b._secondaryKeys.Count)
     {
         return(false);
     }
     foreach (var key in a._secondaryKeys)
     {
         SecondaryKeyInfo bInfo;
         if (!b._secondaryKeys.TryGetValue(key.Key, out bInfo))
         {
             return(false);
         }
         if (!SecondaryKeyInfo.Equal(key.Value, bInfo))
         {
             return(false);
         }
     }
     //Fields
     if (a._fields.Length != b._fields.Length)
     {
         return(false);
     }
     for (int i = 0; i < a._fields.Length; i++)
     {
         if (!TableFieldInfo.Equal(a._fields[i], b._fields[i]))
         {
             return(false);
         }
     }
     return(true);
 }