public override bool Equals(object otherObject) { if (ReferenceEquals(null, otherObject)) { return(false); } if (ReferenceEquals(this, otherObject)) { return(true); } MemoizerConfiguration otherMemoizerConfiguration = otherObject as MemoizerConfiguration; if (otherMemoizerConfiguration == null) { return(false); } return(this.GetHashCode().Equals(otherMemoizerConfiguration.GetHashCode())); }
public Memoizer(MemoizerConfiguration memoizerConfig, bool shared) { this.functionToBeMemoized = memoizerConfig.Function; this.cacheItemPolicy = CacheItemPolicyFactory.CreateCacheItemPolicy(memoizerConfig.ExpirationType, memoizerConfig.ExpirationValue, memoizerConfig.ExpirationTimeUnit); this.key = memoizerConfig.GetHashCode().ToString(); }