コード例 #1
0
        public static IHashingExpression <T> Hash <T, K>(this IHashingDeclaration <T> parameters, Expression <Func <T, K> > selector)
        {
            if (parameters == null)
            {
                throw new NullReferenceException();
            }
            if (selector == null)
            {
                throw new ArgumentNullException("selector");
            }

            return(new HashingExpressionImpl <T>(HashCore(parameters.Parameters, parameters.Composer, parameters.Seed, selector, DefaultHashing <K>()), parameters.Composer));
        }
コード例 #2
0
        public static IHashingExpression <T> NullableHash <T, K>(this IHashingDeclaration <T> parameters, Expression <Func <T, K?> > selector, Expression <Func <K, int> > hashing)
            where K : struct
        {
            if (parameters == null)
            {
                throw new NullReferenceException();
            }
            if (selector == null)
            {
                throw new ArgumentNullException("selector");
            }
            if (hashing == null)
            {
                throw new ArgumentNullException("hashing");
            }

            return(new HashingExpressionImpl <T>(HashCore(parameters.Parameters, parameters.Composer, parameters.Seed, selector, NullableHashing <K>(hashing)), parameters.Composer));
        }
コード例 #3
0
        public static IHashingExpression <T> ObjectHash <T, K>(this IHashingDeclaration <T> parameters, Expression <Func <T, K> > selector, IEqualityComparer <K> equalityComparer)
            where K : class
        {
            if (parameters == null)
            {
                throw new NullReferenceException();
            }
            if (selector == null)
            {
                throw new ArgumentNullException("selector");
            }
            if (equalityComparer == null)
            {
                throw new ArgumentNullException("equalityComparer");
            }

            return(new HashingExpressionImpl <T>(HashCore(parameters.Parameters, parameters.Composer, parameters.Seed, selector, ObjectHashing <K>(ComparerHashing <K>(equalityComparer))), parameters.Composer));
        }