Skip to content

FileMediaMaticFilesourceRepository

Namespace: MJCZone.MediaMatic.AspNetCore.Repositories

Assembly: MJCZone.MediaMatic.AspNetCore

Summary

File-based implementation of IMediaMaticFilesourceRepository that stores filesources in a JSON file with encrypted connection strings.

Inheritance

Base Class: MediaMaticFilesourceRepositoryBase

Implemented Interfaces:

  • IDisposable

sealed public

Contents

Constructors (1) | Methods (15)

Constructors

FileMediaMaticFilesourceRepository

Initializes a new instance of the FileMediaMaticFilesourceRepository class.

csharp
FileMediaMaticFilesourceRepository(
    string filePath,
    IFilesourceIdFactory filesourceIdFactory,
    MediaMaticOptions} options,
    FileMediaMaticFilesourceRepository} logger)

Parameters

  • filePath (string) - The path to the JSON file where filesources will be stored.
  • filesourceIdFactory (IFilesourceIdFactory) - The factory to generate filesource IDs.
  • options (MediaMaticOptions}) - The MediaMatic options containing the encryption key.
  • logger (FileMediaMaticFilesourceRepository}) - The logger instance.

Methods

MethodSummary
Initialize
AddFilesourceAsync
UpdateFilesourceAsync
RemoveFilesourceAsync
GetFilesourcesAsync
GetFilesourceAsync
FilesourceExistsAsync
GetConnectionStringAsync
DisposeReleases all resources used by the current instance of the FileMediaMaticFilesourceRepository clas...
EncryptConnectionStringEncrypts a connection string for secure storage.
DecryptConnectionString/// Decrypts an encrypted connection string for internal use.
GetType
ToString
Equals
GetHashCode

Initialize

csharp
void Initialize()

AddFilesourceAsync

csharp
Task<bool> AddFilesourceAsync()

Returns

Type: Task<bool>

UpdateFilesourceAsync

csharp
Task<bool> UpdateFilesourceAsync()

Returns

Type: Task<bool>

RemoveFilesourceAsync

csharp
Task<bool> RemoveFilesourceAsync()

Returns

Type: Task<bool>

GetFilesourcesAsync

csharp
Task<List<FilesourceDto>> GetFilesourcesAsync()

Returns

Type: Task<List<FilesourceDto>>

GetFilesourceAsync

csharp
Task&lt;FilesourceDto?&gt; GetFilesourceAsync()

Returns

Type: Task<FilesourceDto?>

FilesourceExistsAsync

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

Returns

Type: Task&lt;bool&gt;

GetConnectionStringAsync

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

Returns

Type: Task&lt;string?&gt;

Dispose

Releases all resources used by the current instance of the FileMediaMaticFilesourceRepository class.

csharp
void Dispose()

EncryptConnectionString

Encrypts a connection string for secure storage.

csharp
EncryptConnectionString(string connectionString)

Parameters

  • connectionString (string) - The plain text connection string.

Returns

The encrypted connection string.

DecryptConnectionString

/// Decrypts an encrypted connection string for internal use.

csharp
DecryptConnectionString(string encryptedConnectionString)

Parameters

  • encryptedConnectionString (string) - The encrypted connection string.

Returns

The decrypted plain text connection string.

GetType

csharp
GetType()

ToString

csharp
ToString()

Equals

csharp
Equals()

GetHashCode

csharp
GetHashCode()