Skip to content

DapperMaticCallerDb ​

Namespace: MJCZone.DapperMatic.AspNetCore.Services

Assembly: MJCZone.DapperMatic.AspNetCore

Summary ​

Typed DML for the current request's caller: the request's tenant and values, and the policies of the web API, so that application code reads and writes as the caller would through the API.

sealed public

Contents ​

Constructors (1) | Methods (5)

Constructors ​

DapperMaticCallerDb ​

Initializes a new instance of the DapperMaticCallerDb class.

csharp
DapperMaticCallerDb(
    IHttpContextAccessor http,
    DapperMaticAccess access,
    DapperMaticPolicySet policies,
    IDapperMaticService service)

Parameters ​

  • http (IHttpContextAccessor) - The current request.
  • access (DapperMaticAccess) - The request's caller, tenant and values.
  • policies (DapperMaticPolicySet) - The policies in force.
  • service (IDapperMaticService) - The service, which opens datasources' connections with their session values.

Methods ​

OpenAsync ​

Opens a datasource for the current request's caller: a scope whose statements are held to the policies, in the tenant's schema when it has one, on a connection with the session values the database's own row-level security reads. The connection is closed when the request ends.

csharp
Task<DmScope> OpenAsync(
    string datasourceId,
    CancellationToken cancellationToken)

Parameters ​

  • datasourceId (string) - The datasource.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<DmScope>

The scope.

GetType ​

csharp
GetType()

ToString ​

csharp
ToString()

Equals ​

csharp
Equals()

GetHashCode ​

csharp
GetHashCode()