示例#1
0
        public static FingerprintBuilder <T> For <T>(this FingerprintBuilder <T> builder, Expression <Func <T, string> > expression, bool ignoreCase, bool ignoreWhiteSpace)
        {
            var format = (Func <string, string>)(input =>
            {
                if (ignoreCase)
                {
                    input = input.ToUpperInvariant();
                }

                if (ignoreWhiteSpace)
                {
                    input = input.Trim();
                }

                return(input);
            });

            return(builder.For(expression, input => format(input)));
        }
示例#2
0
 public static FingerprintBuilder <T> Add <T, TInput>(this FingerprintBuilder <T> builder, Expression <Func <T, TInput> > getInputExpression)
 {
     return(builder.Add(getInputExpression, _ => _));
 }
示例#3
0
 public static FingerprintBuilder <T> Add <T>(this FingerprintBuilder <T> builder, Expression <Func <T, string> > getInputExpression, StringOptions options = StringOptions.None)
 {
     return(builder.Add(getInputExpression, input => Format(input, options)));
 }
示例#4
0
 public static FingerprintBuilder <T> For <T, TProperty>(this FingerprintBuilder <T> builder, Expression <Func <T, TProperty> > expression)
 {
     return(builder.For(expression, _ => _));
 }