Exemple #1
0
        public System.Data.Linq.DataContext GetHistoryDataContext()
        {
            if (_historyDataContext == null)
            {
                _historyDataContext = new MovieArchiveDBHistoryDataContext(ConfigurationManager.ConnectionStrings[connectionStringName].ToString());
            }

            return(_historyDataContext);
        }
Exemple #2
0
        public void DestroyContext()
        {
            if (_dataContext != null)
            {
                _dataContext.Connection.Close();
                _dataContext.Dispose();
                _dataContext = null;
            }

            if (_historyDataContext != null)
            {
                _historyDataContext.Connection.Close();
                _historyDataContext.Dispose();
                _historyDataContext = null;
            }
        }