Skip to content

DapperMaticDatasourceRepositoryBase ​

Namespace: MJCZone.DapperMatic.AspNetCore.Repositories

Assembly: MJCZone.DapperMatic.AspNetCore

Summary ​

Base class for datasource repositories: connection strings are encrypted with the configured key, each tagged with the id of the key that encrypted it, so that keys can be rotated.

Inheritance ​

Implemented Interfaces:

abstract public

Note: This is an abstract base class. Concrete implementations can be found in provider-specific namespaces.

Contents ​

Methods (14)

Methods ​

MethodSummary
Initialize
AddDatasourceAsync
DatasourceExistsAsync
GetConnectionStringAsync
GetDatasourceAsync
GetDatasourcesAsync
RemoveDatasourceAsync
UpdateDatasourceAsync
EncryptConnectionStringEncrypts a connection string for secure storage, with the current key, prefixed by that key's id.
DecryptConnectionStringDecrypts an encrypted connection string for internal use, with the key whose id it carries: the curr...
GetType
ToString
Equals
GetHashCode

Initialize ​

csharp
void Initialize()

AddDatasourceAsync ​

csharp
Task<bool> AddDatasourceAsync()

Returns ​

Type: Task<bool>

DatasourceExistsAsync ​

csharp
Task<bool> DatasourceExistsAsync()

Returns ​

Type: Task<bool>

GetConnectionStringAsync ​

csharp
Task<string?> GetConnectionStringAsync()

Returns ​

Type: Task<string?>

GetDatasourceAsync ​

csharp
Task<DatasourceDto?> GetDatasourceAsync()

Returns ​

Type: Task<DatasourceDto?>

GetDatasourcesAsync ​

csharp
Task&lt;List&lt;DatasourceDto&gt;&gt; GetDatasourcesAsync()

Returns ​

Type: Task<List<DatasourceDto>>

RemoveDatasourceAsync ​

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

Returns ​

Type: Task&lt;bool&gt;

UpdateDatasourceAsync ​

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

Returns ​

Type: Task&lt;bool&gt;

EncryptConnectionString ​

Encrypts a connection string for secure storage, with the current key, prefixed by that key's id.

csharp
string EncryptConnectionString(string connectionString)

Parameters ​

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

Returns ​

Type: string

The encrypted connection string, as .

DecryptConnectionString ​

Decrypts an encrypted connection string for internal use, with the key whose id it carries: the current key or one of the previous ones. One stored without a key id is tried with each.

csharp
string DecryptConnectionString(string encryptedConnectionString)

Parameters ​

  • encryptedConnectionString (string) - The encrypted connection string.

Returns ​

Type: string

The decrypted plain text connection string.

GetType ​

csharp
GetType()

ToString ​

csharp
ToString()

Equals ​

csharp
Equals()

GetHashCode ​

csharp
GetHashCode()