Class FileService
Provides functionalities to manage media files.
Implements
Inherited Members
Namespace: DataWeb.Media
Assembly: DataWeb.Core.dll
Syntax
public class FileService : IFileService
Remarks
Initializes a new instance of the MediaService class.
Constructors
FileService(IFileStorageService, IFileStore)
Provides functionalities to manage media files.
Declaration
public FileService(IFileStorageService fileStorageService, IFileStore fileStore)
Parameters
Type | Name | Description |
---|---|---|
IFileStorageService | fileStorageService | The file storage service. |
IFileStore | fileStore | The file store. |
Remarks
Initializes a new instance of the MediaService class.
Methods
CloneFileAndUpdateDataAsync(Dictionary<string, object>, Dictionary<string, object>)
Clones file and updates related data fields.
Declaration
public Task CloneFileAndUpdateDataAsync(Dictionary<string, object> sourceSectionData, Dictionary<string, object> targetSectionData)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<string, object> | sourceSectionData | The source data with file reference. |
Dictionary<string, object> | targetSectionData | The target data with cloned file reference. |
Returns
Type | Description |
---|---|
Task |
GetFile(FileData)
Get a File object from a FileData object.
Declaration
public File GetFile(FileData fileData)
Parameters
Type | Name | Description |
---|---|---|
FileData | fileData | The FileData object. |
Returns
Type | Description |
---|---|
File | The File object. |
GetFileByCodeAsync(string, string, string, string, PublishMode?, CancellationToken)
Get a File by its code.
Declaration
public Task<File> GetFileByCodeAsync(string code, string tagName = null, string versionName = null, string versionCulture = null, PublishMode? publishMode = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | code | The code of the File. |
string | tagName | The tag name of the version. |
string | versionName | The name of the version. |
string | versionCulture | The culture of the version. |
PublishMode? | publishMode | The PublishMode of the version. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<File> | The File. |
GetFileByIdMasterAsync(string, string, string, string, PublishMode?, CancellationToken)
Get a File by its IdMaster.
Declaration
public Task<File> GetFileByIdMasterAsync(string idMaster, string tagName = null, string versionName = null, string versionCulture = null, PublishMode? publishMode = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | idMaster | The IdMaster of the File. |
string | tagName | The tag name of the version. |
string | versionName | The name of the version. |
string | versionCulture | The culture of the version. |
PublishMode? | publishMode | The PublishMode of the version. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<File> | The File. |
GetObsoleteFiles()
Get a list of obsolete Files.
Declaration
public Task<IEnumerable<File>> GetObsoleteFiles()
Returns
Type | Description |
---|---|
Task<IEnumerable<File>> | A list of File. |
UpdateIsInStorage(string, bool)
Update the "isInStorage" property of a File by its IdMaster.
Declaration
public Task UpdateIsInStorage(string fileIdMaster, bool isInStorage)
Parameters
Type | Name | Description |
---|---|---|
string | fileIdMaster | The IdMaster of the File. |
bool | isInStorage | The new value for the "isInStorage" property. |
Returns
Type | Description |
---|---|
Task |