Example #1
0
        public DataEqualityComparer(Type type, CompareOption[] compareOptions, Func <Type, MemberInfo, int> membersOrder = null)
        {
            Type = type;
            CompareOption.CheckCompareOptions(type, compareOptions, membersOrder);
            CompareOptions = compareOptions;
            MembersOrder   = membersOrder;

            equals      = CreateEqualsMethod().Compile();
            getHashCode = CreateGetHashCodeMethod().Compile();
        }
Example #2
0
        public EqualityComparer(CompareOption[] compareOptions, Func <Type, MemberInfo, int> membersOrder = null)
        {
            CompareOption.CheckCompareOptions(typeof(T), compareOptions, membersOrder);
            Type           = typeof(T);
            CompareOptions = compareOptions;
            MembersOrder   = membersOrder;

            equals      = CreateEquals().Compile();
            getHashCode = CreateGetHashCode().Compile();
        }
Example #3
0
        public Comparer(CompareOption[] compareOptions, Func<Type, MemberInfo, int> membersOrder = null)
        {
            Type = typeof(T);
            CompareOptions = compareOptions;
            MembersOrder = membersOrder;

            CompareOption.CheckCompareOptions(Type, compareOptions, membersOrder);

            compare = CreateCompareMethod().Compile();
        }
Example #4
0
        public DataComparer(Type type, CompareOption[] compareOptions, Func <Type, MemberInfo, int> membersOrder = null)
        {
            Type     = type;
            DataType = typeof(Data <>).MakeGenericType(type);

            CompareOption.CheckCompareOptions(type, compareOptions, membersOrder);
            CompareOptions = compareOptions;
            MembersOrder   = membersOrder;

            compare = CreateCompareMethod().Compile();
        }
Example #5
0
        public EqualityComparer(CompareOption[] compareOptions, Func <Type, MemberInfo, int> membersOrder = null)
        {
            Type           = typeof(T);
            CompareOptions = compareOptions;
            CompareOption.CheckCompareOptions(Type, compareOptions, membersOrder);

            MembersOrder = membersOrder;

            LambdaEquals = CreateEquals();
            equals       = LambdaEquals.Compile();

            LambdaGetHashCode = CreateGetHashCode();
            getHashCode       = LambdaGetHashCode.Compile();
        }