示例#1
0
        public static HashCodeBuilder WithCaseInsensitiveString(this HashCodeBuilder builder, string value)
        {
            if (string.IsNullOrWhiteSpace(value))
            {
                return(builder);
            }

            var hashCode = builder.Value * PrimeNumberForHashCodeCalculation + StringComparer.OrdinalIgnoreCase.GetHashCode(value);

            return(HashCodeBuilder.CreateWithValue(hashCode));
        }
示例#2
0
 public static HashCodeBuilder Build(this HashCodeBuilder builder)
 {
     return(builder);
 }
示例#3
0
        public static HashCodeBuilder Add(this HashCodeBuilder builder, HashCodeBuilder toAdd)
        {
            var hashCode = builder.Value * PrimeNumberForHashCodeCalculation + toAdd.Value;

            return(HashCodeBuilder.CreateWithValue(hashCode));
        }
示例#4
0
        public static HashCodeBuilder WithDecimal(this HashCodeBuilder builder, decimal value)
        {
            var hashCode = builder.Value * PrimeNumberForHashCodeCalculation + value.GetHashCode();

            return(HashCodeBuilder.CreateWithValue(hashCode));
        }