Skip to content

DapperMaticTenancyOptions ​

Namespace: MJCZone.DapperMatic.AspNetCore.Models

Assembly: MJCZone.DapperMatic.AspNetCore

Summary ​

Finds the tenant a request acts for in it: its id, from a source; then what is known of the tenant, from configuration or code. Nothing is assumed about what a tenant is: a key on rows, a schema, a datasource, a node of a tree; set what applies.

sealed public

Contents ​

Constructors (1) | Methods (4) | Properties (7)

Constructors ​

DapperMaticTenancyOptions ​

csharp
DapperMaticTenancyOptions()

Methods ​

GetType ​

csharp
GetType()

ToString ​

csharp
ToString()

Equals ​

csharp
Equals()

GetHashCode ​

csharp
GetHashCode()

Properties ​

Sources ​

Gets where a tenant's id is read from: a claim, a header, a route value, a query value, a subdomain.

Type: List<DapperMaticTenantSource>

Tenants ​

Gets what is known of each tenant, by id: its datasource, its schema, its values.

Type: Dictionary<string, DapperMaticTenantSettings>

Values ​

Gets values every tenant has, by name, read as <c>@tenant.name</c>: a fixed value, or one SQL query run when the value is first read (<c>SELECT id FROM core.tenants WHERE path LIKE @tenant.path || '%'</c>).

Type: Dictionary<string, DapperMaticValueSettings>

RequireTenant ​

Gets or sets a value indicating whether a request for a datasource must have a tenant: one without is refused. Default is false.

Type: bool

RowsColumn ​

Gets or sets the column that marks a tenant's rows, in every table that has it, such as <c>tenant_id</c>. The policies a tenant's administrator keeps (WithinOwnTenant) are held to the rows whose column is the tenant's.

Type: string?

RowsColumns ​

Gets the tables whose rows another column marks, by table name, overriding RowsColumn.

Type: Dictionary&lt;string, string&gt;

TenantRulesReach ​

Gets or sets a list value of the request naming the tenants whose rows a tenant's administrators reach, such as <c>@tenant.below</c> for their tenant and those below it; null for their own tenant only.

Type: string?