public object Clone() { StorageConfiguration sConfiguration = new StorageConfiguration(); sConfiguration.Collections = Collections != null ? (CollectionConfigurations)Collections.Clone() : null; sConfiguration.StorageProvider = StorageProvider != null ? (StorageProviderConfiguration)StorageProvider.Clone() : null; sConfiguration.CacheConfiguration = CacheConfiguration != null? (CachingConfiguration)CacheConfiguration.Clone(): null; return(sConfiguration); }
public static void ValidateConfiguration(DatabaseConfiguration configuration) { if (configuration == null) { throw new Exception("Database Configuration cannot be null."); } if (configuration.Name == null) { throw new Exception("Database Name cannot be null."); } if (configuration.Name.Trim() == "") { throw new Exception("Database Name cannot be empty string."); } StorageConfiguration.ValidateConfiguration(configuration.Storage); }
public static void ValidateConfiguration(StorageConfiguration configuration) { if (configuration == null) { throw new Exception("Storage Configuration cannot be null."); } if (configuration.Collections != null) { CollectionConfigurations.ValidateConfiguration(configuration.Collections); } StorageProviderConfiguration.ValidateConfiguration(configuration.StorageProvider); if (configuration.CacheConfiguration != null) { CachingConfiguration.ValidateConfiguration(configuration.CacheConfiguration); } }