예제 #1
0
        public static IRuntimeDatabaseConfiguration For(DatabasePluginProvider <IPlatformDatabaseProvider> provider, DatabaseSettingsSerialization.Source source, DatabaseSettingsSerialization.User user)
        {
            var @params = Read(source, user);

            if (@params.Count == 0)
            {
                return(null);
            }

            var providerKey = DatabaseProviderKey.Deserialize(@params[DatabaseConfigurations.ProviderKeyName].ToString());
            var conf        = provider.GetImplementation(providerKey).CreateEmptyRuntimeDatabaseConfiguration();

            RuntimeDatabaseConfigurations.Fill(conf, @params);

            return(conf);
        }
예제 #2
0
        public static IRuntimeDatabaseConfiguration For(
            DatabasePluginProvider <IPlatformDatabaseProvider> provider,
            DatabaseSettingsSerialization.Source source,
            DatabaseSettingsSerialization.User user,
            DatabaseSettingsSerialization.DataSpace dataSpace,
            ISettingsProvider settingsProvider)
        {
            var providerKeySetting = new Setting <string>(BuildSettingName(source, user, dataSpace, DatabaseConfigurations.ProviderKeyName), string.Empty);
            var providerKeyString  = settingsProvider.Get(providerKeySetting);

            if (string.IsNullOrEmpty(providerKeyString))
            {
                return(null);
            }

            var providerKey = DatabaseProviderKey.Deserialize(providerKeyString);
            var conf        = provider.GetImplementation(providerKey).CreateEmptyRuntimeDatabaseConfiguration();

            RuntimeDatabaseConfigurations.Fill(conf, BuildSettingName(source, user, dataSpace, ""), settingsProvider);

            return(conf);
        }