Esempio n. 1
0
        internal static IRuntimeDatabaseConfiguration CreateDatabaseConfiguration(IPlatformDatabaseProvider databaseProvider, string connectionString,
                                                                                  string onsClusterConfig, string connectionStringExtras, string schema, bool forConnectionState)
        {
            var config = databaseProvider.CreateEmptyRuntimeDatabaseConfiguration();


            connectionStringExtras = connectionStringExtras ?? "";
            var fullConnectionString   = RuntimePlatformUtils.connectionStringJoin(connectionString, connectionStringExtras);
            var databaseIdentifier     = schema;
            var databaseUnicodeSupport = Settings.GetBool(Settings.Configs.Compiler_DatabaseUnicodeSupport);

            var wrapper = new MetaDatabaseConfiguration(config);

            wrapper.GetParameter("ConnectionString").Set(fullConnectionString);
            var sch = wrapper.GetParameter("Schema");

            if (sch != null)
            {
                sch.Set(databaseIdentifier);
            }

            var unicode = wrapper.GetParameter("DatabaseUnicodeSupport");

            if (unicode != null)
            {
                unicode.Set(databaseUnicodeSupport + "");
            }

            return(config);
        }