public object Clone() { CollectionConfigurations config = new CollectionConfigurations(); config.Configuration = Configuration != null?Configuration.Clone <string, CollectionConfiguration>() : null; return(config); }
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); } }
public static void ValidateConfiguration(CollectionConfigurations configuraiton) { if (configuraiton == null) { throw new Exception("Collection Configuration cannot be null."); } foreach (var pair in configuraiton.Configuration) { if (pair.Key == null) { throw new Exception("Collection Name cannot be null."); } if (pair.Key.Trim() == "") { throw new Exception("Collection Name cannot be empty string."); } CollectionConfiguration.ValidateConfiguration(pair.Value); } }