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)); }
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)); }
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)); }