Esempio n. 1
0
        /// <summary>
        /// Creates a domain data service manager with specified repository connection
        /// </summary>
        /// <param name="databaseConfigurationSection">Repository connection string</param>
        /// <returns>Service manager</returns>
        public static IServiceManager CreateServiceManager(DatabaseConfiguration databaseConfigurationSection)
        {
            IServiceManager retVal = null;

            if (databaseConfigurationSection != null)
            {
                string connectionString = string.Empty;

                if (databaseConfigurationSection.EncryptionMethod == Newhl.Common.Encryption.EncryptedConfigurationSection.EncryptionMethodOptions.Internal)
                {
                    connectionString = databaseConfigurationSection.GetDecryptedConnectionString(DefaultEncryptionKey, DefaultSalt);
                }
                else
                {
                    connectionString = databaseConfigurationSection.GetDecryptedConnectionString();
                }

                retVal = CreateServiceManager(connectionString);
            }

            return(retVal);
        }