예제 #1
0
        public void AttachDB(string dbPath, string alias)
        {
            if (dbPath == null)
            {
                throw new ArgumentNullException("dbPath");
            }
            if (String.IsNullOrEmpty(alias))
            {
                throw new ArgumentException("alias can't be null or empty", "alias");
            }

            var externalDS = new ExternalDatastore()
            {
                DbPath = dbPath,
                Alias  = alias
            };

            AttachedDataStores.Add(externalDS);
            var conn = PersistentConnection;

            lock (PersistentConnectionSyncLock)
            {
                AttachDBInternal(conn, externalDS);
            }
        }
예제 #2
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);
            if (isDisposed)
            {
                return;
            }

            if (disposing)
            {
                AttachedDataStores.Clear();
            }
        }
예제 #3
0
        public void AttachDB(Datastore dataStore, string alias)
        {
            if (dataStore == null)
            {
                throw new ArgumentNullException("dataStore");
            }
            if (String.IsNullOrEmpty(alias))
            {
                throw new ArgumentException("alias can't be null or empty", "alias");
            }

            var externalDS = new ExternalDatastore()
            {
                DS    = dataStore,
                Alias = alias
            };

            AttachedDataStores.Add(externalDS);
            var conn = PersistentConnection;

            AttachDBInternal(conn, externalDS);
        }