Exemplo n.º 1
0
 public bool IsMatch(BaseRelationFieldMapping mapping)
 {
     InitialRelateMapping();
     mapping.InitialRelateMapping();
     if (masterEntityMapping.TableName != mapping.masterEntityMapping.TableName)
     {
         return(false);
     }
     if (relateEntityMapping.TableName != mapping.relateEntityMapping.TableName)
     {
         return(false);
     }
     if (keyPairs.Length != mapping.keyPairs.Length)
     {
         return(false);
     }
     foreach (var t in keyPairs)
     {
         var isMatch = false;
         var master  = t;
         foreach (var relate in mapping.keyPairs)
         {
             if (master.IsMatch(relate))
             {
                 isMatch = true;
                 break;
             }
         }
         if (!isMatch)
         {
             return(false);
         }
     }
     return(true);
 }
Exemplo n.º 2
0
 public bool IsMatch(BaseRelationFieldMapping mapping)
 {
     this.InitialRelateMapping();
     mapping.InitialRelateMapping();
     if (this.masterEntityMapping.TableName != mapping.masterEntityMapping.TableName)
     {
         return(false);
     }
     if (this.relateEntityMapping.TableName != mapping.relateEntityMapping.TableName)
     {
         return(false);
     }
     if (this.keyPairs.Length != mapping.keyPairs.Length)
     {
         return(false);
     }
     for (int i = 0; i < this.keyPairs.Length; i++)
     {
         bool        ismatch = false;
         RelationKey master  = this.keyPairs [i];
         for (int j = 0; j < mapping.keyPairs.Length; j++)
         {
             RelationKey relate = mapping.keyPairs [j];
             if (master.IsMatch(relate))
             {
                 ismatch = true;
                 break;
             }
         }
         if (!ismatch)
         {
             return(false);
         }
     }
     return(true);
 }