Example #1
0
        /// <summary>
        /// Gets a db with a specified db identifier
        /// <para />
        /// If live data is required make sure to call LoadDatabases prior to calling this method
        /// </summary>
        /// <param name="dbIdentifier"></param>
        /// <returns></returns>
        public OrganizationDatabase GetDatabase(string dbIdentifier)
        {
            //Note:
            //org dbs data should have been decrypted by the UserConfigurationFilter
            var orgDb = Databases
                        ?.FirstOrDefault(db => db.Identifier == dbIdentifier);

            //If org db is not defined, it means it has not been overwritten at the core meta level, so create it off the web.config
            //as the default api db srv should be used in this scenario
            return(orgDb ?? OrganizationDatabase.CreateInstanceWithDefaultCredentials(Uuid, dbIdentifier));
        }