IMediaMaticFilesourceRepository
Namespace: MJCZone.MediaMatic.AspNetCore.Repositories
Assembly: MJCZone.MediaMatic.AspNetCore
Summary
Repository interface for managing file storage source configurations.
abstract public
Note: This is an interface that defines a contract. Look for implementing classes in the same or related namespaces.
Contents
Methods (8)
Methods
| Method | Summary |
|---|---|
| Initialize | Initializes the repository, creating necessary storage structures if they don't exist. This method s... |
| AddFilesourceAsync | Adds a new filesource registration. |
| UpdateFilesourceAsync | Updates an existing filesource registration. Behaves like a patch. All NULL properties are ignored. |
| RemoveFilesourceAsync | Removes a filesource registration by ID. |
| GetFilesourcesAsync | Gets a list of all registered filesources and their metadata (excluding connection strings). |
| GetFilesourceAsync | Gets filesource information by ID (excluding connection string). |
| FilesourceExistsAsync | Checks if a filesource with the specified ID exists. |
| GetConnectionStringAsync | Gets a connection string for internal use by MediaMatic services. This method is for internal use on... |
Initialize
Initializes the repository, creating necessary storage structures if they don't exist. This method should be called once during application startup.
void Initialize()AddFilesourceAsync
Adds a new filesource registration.
Task<bool> AddFilesourceAsync(FilesourceDto filesource)Parameters
- filesource (FilesourceDto) - The filesource to add.
Returns
Type: Task<bool>
True if added successfully, false if a filesource with the same ID already exists.
UpdateFilesourceAsync
Updates an existing filesource registration. Behaves like a patch. All NULL properties are ignored.
Task<bool> UpdateFilesourceAsync(FilesourceDto filesource)Parameters
- filesource (FilesourceDto) - The updated filesource information.
Returns
Type: Task<bool>
True if updated successfully, false if the filesource doesn't exist.
RemoveFilesourceAsync
Removes a filesource registration by ID.
Task<bool> RemoveFilesourceAsync(string id)Parameters
- id (string) - The ID of the filesource to remove.
Returns
Type: Task<bool>
True if removed successfully, false if the filesource doesn't exist.
GetFilesourcesAsync
Gets a list of all registered filesources and their metadata (excluding connection strings).
Task<List<FilesourceDto>> GetFilesourcesAsync(string tag)Parameters
- tag (string) - Optional tag to filter filesources by. If null, returns all filesources.
Returns
Type: Task<List<FilesourceDto>>
A collection of filesource information without connection strings.
GetFilesourceAsync
Gets filesource information by ID (excluding connection string).
Task<FilesourceDto?> GetFilesourceAsync(string id)Parameters
- id (string) - The ID of the filesource.
Returns
Type: Task<FilesourceDto?>
The filesource information without connection string, or null if not found.
FilesourceExistsAsync
Checks if a filesource with the specified ID exists.
Task<bool> FilesourceExistsAsync(string id)Parameters
- id (string) - The ID of the filesource to check.
Returns
Type: Task<bool>
True if the filesource exists, false otherwise.
GetConnectionStringAsync
Gets a connection string for internal use by MediaMatic services. This method is for internal use only and should not be exposed through APIs.
Task<string?> GetConnectionStringAsync(string id)Parameters
- id (string) - The ID of the filesource.
Returns
Type: Task<string?>
The connection string if found, null otherwise.