示例#1
0
        public static IStorageClient Create(StorageClientType storageClientType)
        {
            switch (storageClientType)
            {
            case StorageClientType.File:
                return(new FileStorageClient());

            case StorageClientType.AzureStorageContainer:
                return(new AzureStorageContainerStorageClient());

            default:
                throw new ArgumentOutOfRangeException($"StorageClientType {storageClientType} does not exist");
            }
        }
        public static IStorageManager CreateDatabaseManager(string connectionString, StorageClientType storageClientType = StorageClientType.Default)
        {
            switch (storageClientType)
            {
            case StorageClientType.Default:
            case StorageClientType.SqlServer:
                return(new SqlServerStorageManager(connectionString));

            case StorageClientType.Oracle:
                return(new OracleStorageManager(connectionString));

            case StorageClientType.FileSystem:
                return(new FileSystemStorageManager(connectionString));

            default: throw new InvalidOperationException($"Il tipo di storage {storageClientType} non è supportato");
            }
        }