예제 #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));
        }