public object Clone() { StorageProviderConfiguration SPConfiguration = new StorageProviderConfiguration(); SPConfiguration.DatabaseId = DatabaseId; SPConfiguration.DatabasePath = DatabasePath; SPConfiguration.LMDBProvider = LMDBProvider != null ? (LMDBConfiguration)LMDBProvider.Clone() : null; SPConfiguration.StorageProviderType = StorageProviderType; SPConfiguration.MaxFileSize = MaxFileSize; SPConfiguration.ProviderTypeString = ProviderTypeString; SPConfiguration.IsMultiFileStore = IsMultiFileStore; return(SPConfiguration); }
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(StorageProviderConfiguration configuration) { if (configuration == null) { throw new Exception("Storage Provider Configuration cannot be null."); } //?? //else if (configuration.DatabaseId == null) // throw new Exception("Database Id cannot be null."); //else if (configuration.DatabaseId.Trim() == "") // throw new Exception("Database Id cannot be empty string."); if (configuration.LMDBProvider != null) { LMDBConfiguration.ValidateConfiguration(configuration.LMDBProvider); } else { throw new Exception("Storage Provider Configuration cannot be null."); } }