Exemple #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);
            }
        }
Exemple #2
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);
        }