Class StorageServiceFactory
Implements
Inherited Members
Namespace: LemonEdge.API.Core.Storage
Assembly: LemonEdge.API.dll
Syntax
public class StorageServiceFactory : IStorageServiceFactory
Constructors
StorageServiceFactory(IStorageServiceRepository, IFactoryInjector, IOptions<StorageSettings>)
Declaration
public StorageServiceFactory(IStorageServiceRepository storageServiceRepository, IFactoryInjector factoryInjector, IOptions<StorageSettings> config)
Parameters
Type | Name | Description |
---|---|---|
IStorageServiceRepository | storageServiceRepository | |
IFactoryInjector | factoryInjector | |
IOptions<StorageSettings> | config |
Properties
ValidStorageTypes
Returns a list of the keys for all valid storage implementations that the system can use
Declaration
public IEnumerable<string> ValidStorageTypes { get; }
Property Value
Type | Description |
---|---|
IEnumerable<string> |
Methods
Create(string, StorageSettings)
Creates an IStorageService using the key from the config settings or the manual override key provided. Can return null in the event of no / incorrect config. Optionally, a storage settings override can be provided.
Uses the configured StorageType, StorageConnectionString, and StorageBasePath
Declaration
public IStorageService Create(string overrideKey = null, StorageSettings storageSettingsOverride = null)
Parameters
Type | Name | Description |
---|---|---|
string | overrideKey | |
StorageSettings | storageSettingsOverride |
Returns
Type | Description |
---|---|
IStorageService | A task holding the newly created Storage Manager |
Create(string, string, string)
Creates an IStorageService from the specified settings
Declaration
public IStorageService Create(string storageTypeKey, string connectionString, string basePath)
Parameters
Type | Name | Description |
---|---|---|
string | storageTypeKey | The type of storage to use for saving task server results. System keys are Local and Azure. |
string | connectionString | The default connection string to the storage type. For azure this is an azure storage connection string, for a local drive it's just the drive name |
string | basePath | The base path to store everything in the storage type. For Azure this is a container, for a local file system it's just a folder path. |
Returns
Type | Description |
---|---|
IStorageService | A task holding the newly created Storage Manager |