Esempio n. 1
0
        /// <summary>
        /// Initializes a database context to access the cache database.
        /// </summary>
        private void InitializeDatabaseContext()
        {
            lock (this.SyncRoot)
            {
                if (this.cacheDatabaseContext != null)
                {
                    return;
                }

                this.cacheDatabaseContext = CacheDatabaseProvider.Instance.CacheDatabase;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Disposes off this instance.
        /// </summary>
        /// <param name="disposing"><c>true</c> if called from Dispose method.</param>
        protected virtual void Dispose(bool disposing)
        {
            if (!this.disposedValue)
            {
                if (disposing)
                {
                    if (this.lowerQuerier != null)
                    {
                        this.lowerQuerier.Dispose();
                        this.lowerQuerier = null;
                    }

                    if (this.cacheDatabaseContext != null)
                    {
                        this.cacheDatabaseContext.Dispose();
                        this.cacheDatabaseContext = null;
                    }
                }

                this.disposedValue = true;
            }
        }