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
| Method | Summary |
|---|---|
| Initialize | |
| AddDatasourceAsync | |
| DatasourceExistsAsync | |
| GetConnectionStringAsync | |
| GetDatasourceAsync | |
| GetDatasourcesAsync | |
| RemoveDatasourceAsync | |
| UpdateDatasourceAsync | |
| EncryptConnectionString | Encrypts a connection string for secure storage, with the current key, prefixed by that key's id. |
| DecryptConnectionString | Decrypts an encrypted connection string for internal use, with the key whose id it carries: the curr... |
| GetType | |
| ToString | |
| Equals | |
| GetHashCode |
Initialize
void Initialize()AddDatasourceAsync
Task<bool> AddDatasourceAsync()Returns
Type: Task<bool>
DatasourceExistsAsync
Task<bool> DatasourceExistsAsync()Returns
Type: Task<bool>
GetConnectionStringAsync
Task<string?> GetConnectionStringAsync()Returns
Type: Task<string?>
GetDatasourceAsync
Task<DatasourceDto?> GetDatasourceAsync()Returns
Type: Task<DatasourceDto?>
GetDatasourcesAsync
Task<List<DatasourceDto>> GetDatasourcesAsync()Returns
Type: Task<List<DatasourceDto>>
RemoveDatasourceAsync
Task<bool> RemoveDatasourceAsync()Returns
Type: Task<bool>
UpdateDatasourceAsync
Task<bool> UpdateDatasourceAsync()Returns
Type: Task<bool>
EncryptConnectionString
Encrypts a connection string for secure storage, with the current key, prefixed by that key's id.
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.
string DecryptConnectionString(string encryptedConnectionString)Parameters
- encryptedConnectionString (string) - The encrypted connection string.
Returns
Type: string
The decrypted plain text connection string.
GetType
GetType()ToString
ToString()Equals
Equals()GetHashCode
GetHashCode()