/// <summary> /// Disposes all resources (see <see cref="Flush(bool)"/>) and invokes the <see cref="CachePolicyManager.Unregister(string)"/> for the <see cref="PolicyKey"/>. /// </summary> public void Dispose() { lock (Lock) { Flush(true); CachePolicyManager.Unregister(PolicyKey); } }
/// <summary> /// Releases the unmanaged resources used by the <see cref="CacheCoreBase"/> and optionally releases the managed resources. /// </summary> /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> protected virtual void Dispose(bool disposing) { if (_disposed) { return; } if (disposing) { lock (Lock) { Flush(true); CachePolicyManager.Unregister(PolicyKey); } } _disposed = true; }