Exemple #1
0
        private bool TryFindComplexMatchFor(
            PropertyOrField master,
            PropertyOrField[] compareMembers)
        {
            var nameMatch = compareMembers.FirstOrDefault(c => c.Name == master.Name);

            return(nameMatch == null
                    ? AddError($"No property found to match {master.Name} by name on {_compare}")
                    : DeepCompare(master.Type, nameMatch.Type));
        }
Exemple #2
0
 private bool TryFindPrimitiveMatchFor(PropertyOrField cur, PropertyOrField[] compareMembers)
 {
     return(compareMembers.ContainsOnlyOneMatching(
                cur,
                (o1, o2) => AllowAssignmentEquivalence
                             ? o1.IsAssignmentMatchFor(o2)
                             : o1.IsMatchFor(o2)
                ) ||
            AddError($"No match for: {cur.PrettyPrint()}"));
 }