Ejemplo n.º 1
0
        private ComparsionDelegate <T1, T2> GetTwoSidedComparsionStep(MatchingMemberInfo <T1, T2> mmi)
        {
            if (mmi.BothSidesAreNotCollection)
            {
                if (mmi.LeftSideItem.CompareByValue && mmi.RightSideItem.CompareByValue)
                {
                    return(ValueComparsionStep <T1, T2> .Create(mmi.Name, mmi.LeftSideItem.GetValueFunc, mmi.RightSideItem.GetValueFunc));
                }

                return(ObjectComparsionStep <T1, T2> .Create(mmi, _configuration));
            }

            if (mmi.BothSidesAreCollections)
            {
                return(CollectionComparsionStep <T1, T2> .Create(mmi, _configuration));
            }

            return(CollectionToValueComparsionAlwaysFalseStep <T1, T2> .Create(mmi.Name));
        }
Ejemplo n.º 2
0
 private bool FilterIgnoredTypes(MatchingMemberInfo <T1, T2> mmi)
 => !((mmi.LeftSideItem != null && _configuration.IsTypeIgnored(mmi.LeftSideItem.MemberType)) ||
      (mmi.RightSideItem != null && _configuration.IsTypeIgnored(mmi.RightSideItem.MemberType)));
Ejemplo n.º 3
0
 private bool FilterCollections(MatchingMemberInfo <T1, T2> mmi)
 => (_configuration.UseCollections) || mmi.BothSidesAreNotCollection;
Ejemplo n.º 4
0
 private bool FilterByOnlyMatchingMembers(MatchingMemberInfo <T1, T2> mmi)
 => (_configuration.OnlyMatchingMembers)
         ? mmi.MatchingType == MatchingType.Both
         : mmi.MatchingType != MatchingType.None;
Ejemplo n.º 5
0
 private bool FilterIgnoredMembers(MatchingMemberInfo <T1, T2> mmi)
 => !((mmi.LeftSideItem != null && _configuration.IsMemberIgnored(typeof(T1), mmi.Name)) ||
      (mmi.RightSideItem != null && _configuration.IsMemberIgnored(typeof(T2), mmi.Name)));