Esempio n. 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));
        }
Esempio n. 2
0
        public static HashCodeBuilder Add(this HashCodeBuilder builder, HashCodeBuilder toAdd)
        {
            var hashCode = builder.Value * PrimeNumberForHashCodeCalculation + toAdd.Value;

            return(HashCodeBuilder.CreateWithValue(hashCode));
        }
Esempio n. 3
0
        public static HashCodeBuilder WithDecimal(this HashCodeBuilder builder, decimal value)
        {
            var hashCode = builder.Value * PrimeNumberForHashCodeCalculation + value.GetHashCode();

            return(HashCodeBuilder.CreateWithValue(hashCode));
        }