/// <inheritdoc/>
        public bool Equals(StoreResult <T> other)
        {
            if (other == null)
            {
                return(false);
            }

            if (this.Contains != other.Contains)
            {
                return(false);
            }

            if (!this.Contains)
            {
                return(true);
            }

            return(this.presistedValue.Equals(other.GetPresistedValue()));
        }
        /// <summary>Adds instance to cache.</summary>
        /// <typeparam name="T">Type of presisted value.</typeparam>
        /// <param name="value">Values that should be added to cache.</param>
        /// <returns>Returns value currently stored in cache.</returns>
        /// <exception cref="ArgumentNullException">Throws <see cref="ArgumentNullException"/> if value is null.</exception>
        /// <exception cref="ArgumentException">Throws <see cref="ArgumentException"/> if value did not have Contains set to true.</exception>
        public StoreResult <T> AddOrGet <T>(StoreResult <T> value)
        {
            if (value == null)
            {
                throw new ArgumentNullException(nameof(value));
            }

            if (!value.Contains)
            {
                throw new ArgumentException("Contains was false.", nameof(value));
            }

            var key        = value.GetPresistedValue().Checksum.ToString();
            var cacheValue = (StoreResult <T>) this.memoryCache.AddOrGetExisting(key, value, new CacheItemPolicy());

            if (cacheValue == null)
            {
                return(value);
            }

            return(cacheValue);
        }