Interface IDocumentStorageService
The contact for fetching and saving documents. To implement a new mechanism, be sure to inherit this interface and also, mark the concrete type with StoresDocumentsAttribute, which should have a unique key. Also, ensure you have a config section like this in the application: "DocumentStorageSettings": { "Selected": "{Your Attribute Key}", "Available": [ { "Key": "{Your Attribute Key}", "ConnectionString": "{your connection string}", "ContainerName": "{the container}" }, { "Key": "AzureFileShare", "ConnectionString": "...", "ContainerName": "..." } ]
Namespace: LemonEdge.API.Core.Storage
Assembly: LemonEdge.API.dll
Syntax
public interface IDocumentStorageService
Methods
Delete(string)
Deletes a file from storage.
Declaration
Task<bool> Delete(string uri)
Parameters
Type | Name | Description |
---|---|---|
string | uri | The absolute uri to the document |
Returns
Type | Description |
---|---|
Task<bool> |
Get(string)
Gets a file from storage.
Declaration
Task<byte[]> Get(string uri)
Parameters
Type | Name | Description |
---|---|---|
string | uri | The absolute uri to the document |
Returns
Type | Description |
---|---|
Task<byte[]> |
Save(byte[], string)
Saves a file to storage.
Declaration
Task<string> Save(byte[] data, string fullPath)
Parameters
Type | Name | Description |
---|---|---|
byte[] | data | The binary data of the file |
string | fullPath | The path and name of the file |
Returns
Type | Description |
---|---|
Task<string> | The absolute url to the saved file |