Skip to content

DatabaseMediaMaticFilesourceRepository ​

Namespace: MJCZone.MediaMatic.AspNetCore.Repositories

Assembly: MJCZone.MediaMatic.AspNetCore

Summary ​

Database-based implementation of IMediaMaticFilesourceRepository that stores filesources in a vfs table with encrypted connection strings.

Inheritance ​

Base Class: MediaMaticFilesourceRepositoryBase

sealed public

Contents ​

Constructors (1) | Methods (14)

Constructors ​

DatabaseMediaMaticFilesourceRepository ​

Initializes a new instance of the DatabaseMediaMaticFilesourceRepository class.

csharp
DatabaseMediaMaticFilesourceRepository(
    string provider,
    string connectionString,
    IDbConnectionFactory connectionFactory,
    IFilesourceIdFactory filesourceIdFactory,
    MediaMaticOptions} options,
    DatabaseMediaMaticFilesourceRepository} logger)

Parameters ​

  • provider (string) - The database provider name.
  • connectionString (string) - The connection string for the database.
  • connectionFactory (IDbConnectionFactory) - The connection factory for creating database connections to store filesource connection information.
  • filesourceIdFactory (IFilesourceIdFactory) - The factory for generating filesource IDs.
  • options (MediaMaticOptions}) - The MediaMatic options containing the encryption key.
  • logger (DatabaseMediaMaticFilesourceRepository}) - The logger instance.

Methods ​

MethodSummary
Initialize
AddFilesourceAsync
UpdateFilesourceAsync
RemoveFilesourceAsync
GetFilesourcesAsync
GetFilesourceAsync
FilesourceExistsAsync
GetConnectionStringAsync
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;

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()