public static Func <T, int> Hashing <T>(this IHashingExpression <T> hashing) { if (hashing == null) { throw new NullReferenceException(); } return(hashing.Expression.Compile()); }
public static IHashingExpression <T> Hash <T, K>(this IHashingExpression <T> expression, Expression <Func <T, K> > selector) { if (expression == null) { throw new NullReferenceException(); } if (selector == null) { throw new ArgumentNullException("selector"); } return(new HashingExpressionImpl <T>(HashCore(expression.Expression, expression.Composer, selector, DefaultHashing <K>()), expression.Composer)); }
public static IHashingExpression <T> NullableHash <T, K>(this IHashingExpression <T> expression, Expression <Func <T, K?> > selector, Expression <Func <K, int> > hashing) where K : struct { if (expression == null) { throw new NullReferenceException(); } if (selector == null) { throw new ArgumentNullException("selector"); } if (hashing == null) { throw new ArgumentNullException("hashing"); } return(new HashingExpressionImpl <T>(HashCore(expression.Expression, expression.Composer, selector, NullableHashing <K>(hashing)), expression.Composer)); }
public static IHashingExpression <T> NullableHash <T, K>(this IHashingExpression <T> expression, Expression <Func <T, K?> > selector, IEqualityComparer <K> equalityComparer) where K : struct { if (expression == null) { throw new NullReferenceException(); } if (selector == null) { throw new ArgumentNullException("selector"); } if (equalityComparer == null) { throw new ArgumentNullException("equalityComparer"); } return(new HashingExpressionImpl <T>(HashCore(expression.Expression, expression.Composer, selector, NullableHashing <K>(ComparerHashing <K>(equalityComparer))), expression.Composer)); }
public static IEqualityComparer <T> EqualityComparer <T>(this IEqualityExpression <T> equality, IHashingExpression <T> hashing) { if (equality == null) { throw new NullReferenceException(); } if (hashing == null) { throw new ArgumentNullException("hashing"); } return(new CustomEqualityComparer <T>(equality.Expression.Compile(), hashing.Expression.Compile())); }