Example #1
0
        public AutoHash(Func <TKey, TValue> defaultLambda, bool autoAddDefault, IEqualityComparer <TKey> comparer) : this(comparer)
        {
            defaultLambda.Must().Not.BeNull().OrThrow();
            comparer.Must().Not.BeNull().OrThrow();

            Default            = DefaultType.Lambda;
            this.defaultLambda = defaultLambda;
            AutoAddDefault     = autoAddDefault;
        }
Example #2
0
        public AutoHash(TValue defaultValue, bool autoAddDefault, IEqualityComparer <TKey> comparer) : this(comparer)
        {
            comparer.Must().Not.BeNull().OrThrow();

            Default        = DefaultType.Value;
            DefaultValue   = defaultValue;
            AutoAddDefault = autoAddDefault;

            defaultLambda = _ => default;
        }