Skip to content

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

MethodSummary
InitializeInitializes the repository, creating necessary storage structures if they don't exist. This method s...
AddFilesourceAsyncAdds a new filesource registration.
UpdateFilesourceAsyncUpdates an existing filesource registration. Behaves like a patch. All NULL properties are ignored.
RemoveFilesourceAsyncRemoves a filesource registration by ID.
GetFilesourcesAsyncGets a list of all registered filesources and their metadata (excluding connection strings).
GetFilesourceAsyncGets filesource information by ID (excluding connection string).
FilesourceExistsAsyncChecks if a filesource with the specified ID exists.
GetConnectionStringAsyncGets 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.

csharp
void Initialize()

AddFilesourceAsync

Adds a new filesource registration.

csharp
Task<bool> AddFilesourceAsync(FilesourceDto filesource)

Parameters

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.

csharp
Task<bool> UpdateFilesourceAsync(FilesourceDto filesource)

Parameters

Returns

Type: Task<bool>

True if updated successfully, false if the filesource doesn't exist.

RemoveFilesourceAsync

Removes a filesource registration by ID.

csharp
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).

csharp
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).

csharp
Task&lt;FilesourceDto?&gt; 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.

csharp
Task&lt;bool&gt; FilesourceExistsAsync(string id)

Parameters

  • id (string) - The ID of the filesource to check.

Returns

Type: Task&lt;bool&gt;

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.

csharp
Task&lt;string?&gt; GetConnectionStringAsync(string id)

Parameters

  • id (string) - The ID of the filesource.

Returns

Type: Task&lt;string?&gt;

The connection string if found, null otherwise.