Skip to content

DapperMaticAccessManager ​

Namespace: MJCZone.DapperMatic.AspNetCore.Services

Assembly: MJCZone.DapperMatic.AspNetCore

Summary ​

The built-in accounts, for administrators: those who manage access to everything see and manage every account, its platform roles and grants; a tenant's administrators manage their tenant's members and invitations (giving only roles they may give) and see, and revoke, the grants to their tenant. Callers signed in by a key manage none of it.

sealed public

Contents ​

Constructors (1) | Methods (40)

Constructors ​

DapperMaticAccessManager ​

Initializes a new instance of the DapperMaticAccessManager class.

csharp
DapperMaticAccessManager(
    DapperMaticPolicySet policies,
    DapperMaticStoredAccess stored,
    IDapperMaticPermissions permissions,
    IDapperMaticAuditLogger auditLogger,
    IDapperMaticService service,
    DapperMaticOptions} options,
    DapperMaticChangeLog changes,
    IDapperMaticDatasourceRepository datasources,
    IDbConnectionFactory connections,
    IServiceProvider services)

Parameters ​

Methods ​

MethodSummary
GetAccountsAsyncLists accounts: every one, a tenant's members, or a tenant administrator's members.
SetPlatformRolesAsyncSets an account's platform roles: by those who manage access to everything.
SetDisabledAsyncTurns an account off (its sign-ins, sessions and keys end) or on: by those who manage access to ever...
SaveMembershipAsyncGives an account a membership of a tenant, or changes its roles there.
DeleteMembershipAsyncRemoves an account's membership of a tenant.
GetGrantsAsyncLists grants: to a tenant administrator's tenant, or to any tenant for those who manage everything.
GrantAsyncGrants a platform user a tenant's roles until a time (within the longest grant): by those who manage...
RevokeGrantAsyncRevokes a grant: the tenant's administrators may revoke those to their tenant.
GetInvitationsAsyncLists invitations not accepted: a tenant administrator's tenant's, or any for those who manage every...
InviteAsyncInvites an email: a tenant administrator to their tenant (roles they may give); those who manage eve...
DeleteInvitationAsyncWithdraws an invitation.
GetPoliciesAsyncLists the policies in force that the caller may manage: of code and configuration (their <c>So...
GetPolicyAsyncGets a policy in force by its name: the application's, or, with <paramref name="tenant" />, a ...
SavePolicyAsyncAdds a policy to those kept by DapperMatic, or replaces the kept one of the same name (and tenant). ...
DeletePolicyAsyncRemoves a policy kept by DapperMatic: the application's, or, with <paramref name="tenant" />, ...
GetTenantsAsyncLists the tenants the caller may manage: of configuration, and kept by DapperMatic (which win).
GetTenantAsyncGets a tenant by its id.
SaveTenantAsyncAdds a tenant to those kept by DapperMatic, or replaces the kept one of the same id. A tenant of con...
DeleteTenantAsyncRemoves a tenant kept by DapperMatic.
ExportAsyncExports the policies and tenants kept by DapperMatic that the caller may manage.
ImportAsyncImports policies and tenants: every one is checked before any is kept. Importing needs access manage...
GetEffectiveAsyncWorks out what the policies let the caller do to a datasource, schema, table or view: for a user int...
GetServiceAccountsAsyncLists the service accounts the caller manages: a tenant administrator's, their tenant's.
SaveServiceAccountAsyncAdds a service account, or replaces the kept one of the same name (and tenant). A tenant's administr...
DeleteServiceAccountAsyncRemoves a kept service account, and revokes its keys.
CreateServiceKeyAsyncMakes a key for a service account: shown this once.
GetKeysAsyncLists keys the caller manages, without their secrets: every one, or a tenant administrator's tenant'...
RevokeKeyAsyncRevokes a key the caller manages: it no longer signs in, and is still listed.
GetOwnKeysAsyncLists the caller's own personal keys.
CreateOwnKeyAsyncMakes a personal key for the caller, in their tenant: it acts as them, as they are each time it is u...
RevokeOwnKeysAsyncRevokes one of the caller's personal keys, or every one.
GetWebhooksAsyncLists the webhooks the caller may manage, their secrets masked: of code and configuration, and kept....
GetWebhookAsyncGets a webhook by its name, its secret masked.
SaveWebhookAsyncAdds a webhook to those kept, or replaces the kept one of the same name (and tenant); a secret left ...
DeleteWebhookAsyncRemoves a webhook kept by DapperMatic.
GetWebhookStatusAsyncReads where a webhook's messages have got to, in each datasource it hears: the messages taken and dr...
GetType
ToString
Equals
GetHashCode

GetAccountsAsync ​

Lists accounts: every one, a tenant's members, or a tenant administrator's members.

csharp
Task&lt;IReadOnlyList&lt;DapperMaticAccountSummary&gt;&gt; GetAccountsAsync(
    DapperMaticOperation context,
    string tenant,
    string after,
    int take,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • tenant (string) - A tenant whose members to list, or null.
  • after (string) - The last email of the page before, or null.
  • take (int) - How many at most (1 to 1,000).
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<IReadOnlyList<DapperMaticAccountSummary>>

The accounts.

SetPlatformRolesAsync ​

Sets an account's platform roles: by those who manage access to everything.

csharp
Task SetPlatformRolesAsync(
    DapperMaticOperation context,
    string userId,
    String} roles,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • userId (string) - The account's id.
  • roles (String}) - The roles.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task

A task.

SetDisabledAsync ​

Turns an account off (its sign-ins, sessions and keys end) or on: by those who manage access to everything.

csharp
Task SetDisabledAsync(
    DapperMaticOperation context,
    string userId,
    bool disabled,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • userId (string) - The account's id.
  • disabled (bool) - Whether it is off.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task

A task.

SaveMembershipAsync ​

Gives an account a membership of a tenant, or changes its roles there.

csharp
Task&lt;DapperMaticMembershipInfo&gt; SaveMembershipAsync(
    DapperMaticOperation context,
    string tenant,
    string userId,
    DapperMaticMembershipRequest request,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • tenant (string) - The tenant (a tenant administrator's own).
  • userId (string) - The account's id.
  • request (DapperMaticMembershipRequest) - The roles.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<DapperMaticMembershipInfo>

The membership.

DeleteMembershipAsync ​

Removes an account's membership of a tenant.

csharp
Task DeleteMembershipAsync(
    DapperMaticOperation context,
    string tenant,
    string userId,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • tenant (string) - The tenant (a tenant administrator's own).
  • userId (string) - The account's id.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task

A task.

GetGrantsAsync ​

Lists grants: to a tenant administrator's tenant, or to any tenant for those who manage everything.

csharp
Task&lt;IReadOnlyList&lt;DapperMaticMembershipInfo&gt;&gt; GetGrantsAsync(
    DapperMaticOperation context,
    string tenant,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • tenant (string) - A tenant, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<IReadOnlyList<DapperMaticMembershipInfo>>

The grants, live or not.

GrantAsync ​

Grants a platform user a tenant's roles until a time (within the longest grant): by those who manage everything. The audit names the grant on everything done under it.

csharp
Task&lt;DapperMaticMembershipInfo&gt; GrantAsync(
    DapperMaticOperation context,
    DapperMaticGrantRequest request,
    CancellationToken cancellationToken)

Parameters ​

Returns ​

Type: Task<DapperMaticMembershipInfo>

The grant.

RevokeGrantAsync ​

Revokes a grant: the tenant's administrators may revoke those to their tenant.

csharp
Task RevokeGrantAsync(
    DapperMaticOperation context,
    string id,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • id (string) - The grant's id.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task

A task.

GetInvitationsAsync ​

Lists invitations not accepted: a tenant administrator's tenant's, or any for those who manage everything.

csharp
Task&lt;IReadOnlyList&lt;DapperMaticInvitationInfo&gt;&gt; GetInvitationsAsync(
    DapperMaticOperation context,
    string tenant,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • tenant (string) - A tenant, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<IReadOnlyList<DapperMaticInvitationInfo>>

The invitations.

InviteAsync ​

Invites an email: a tenant administrator to their tenant (roles they may give); those who manage everything to any tenant, or to the platform.

csharp
Task&lt;DapperMaticInvitationCreated&gt; InviteAsync(
    DapperMaticOperation context,
    DapperMaticInvitationRequest request,
    CancellationToken cancellationToken)

Parameters ​

Returns ​

Type: Task<DapperMaticInvitationCreated>

The invitation, its token shown this once.

DeleteInvitationAsync ​

Withdraws an invitation.

csharp
Task DeleteInvitationAsync(
    DapperMaticOperation context,
    string id,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • id (string) - The invitation's id.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task

A task.

GetPoliciesAsync ​

Lists the policies in force that the caller may manage: of code and configuration (their <c>Source</c> says so), and kept by DapperMatic. A tenant's administrator sees their tenant's; another administrator sees every one they manage, or one tenant's when <paramref name="tenant" /> names it.

csharp
Task&lt;IReadOnlyList&lt;DmPolicy&gt;&gt; GetPoliciesAsync(
    DapperMaticOperation context,
    string tenant,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • tenant (string) - A tenant whose policies to list, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<IReadOnlyList<DmPolicy>>

The policies.

GetPolicyAsync ​

Gets a policy in force by its name: the application's, or, with <paramref name="tenant" />, a tenant's (a tenant's administrator always gets their tenant's).

csharp
Task&lt;DmPolicy&gt; GetPolicyAsync(
    DapperMaticOperation context,
    string name,
    string tenant,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • name (string) - The policy's name.
  • tenant (string) - The tenant the policy is one of, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<DmPolicy>

The policy.

SavePolicyAsync ​

Adds a policy to those kept by DapperMatic, or replaces the kept one of the same name (and tenant). It applies to the next request. A tenant's administrator keeps their tenant's policies only: each is held to the tenant's rows (or datasource or schema), names its tables, and gives no more than the administrator may do.

csharp
Task&lt;DmPolicy&gt; SavePolicyAsync(
    DapperMaticOperation context,
    string name,
    DmPolicy policy,
    string tenant,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • name (string) - The policy's name.
  • policy (DmPolicy) - The policy.
  • tenant (string) - The tenant the policy is one of, or null for the application's.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<DmPolicy>

The policy kept.

DeletePolicyAsync ​

Removes a policy kept by DapperMatic: the application's, or, with <paramref name="tenant" />, a tenant's (a tenant's administrator always removes their tenant's).

csharp
Task DeletePolicyAsync(
    DapperMaticOperation context,
    string name,
    string tenant,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • name (string) - The policy's name.
  • tenant (string) - The tenant the policy is one of, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task

A task.

GetTenantsAsync ​

Lists the tenants the caller may manage: of configuration, and kept by DapperMatic (which win).

csharp
Task&lt;IReadOnlyDictionary&lt;string, DapperMaticTenantSettings&gt;&gt; GetTenantsAsync(
    DapperMaticOperation context,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<IReadOnlyDictionary<string, DapperMaticTenantSettings>>

The tenants, by id.

GetTenantAsync ​

Gets a tenant by its id.

csharp
Task&lt;DapperMaticTenantSettings&gt; GetTenantAsync(
    DapperMaticOperation context,
    string id,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • id (string) - The tenant's id.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<DapperMaticTenantSettings>

What is known of it.

SaveTenantAsync ​

Adds a tenant to those kept by DapperMatic, or replaces the kept one of the same id. A tenant of configuration with the id is overridden.

csharp
Task&lt;DapperMaticTenantSettings&gt; SaveTenantAsync(
    DapperMaticOperation context,
    string id,
    DapperMaticTenantSettings tenant,
    CancellationToken cancellationToken)

Parameters ​

Returns ​

Type: Task<DapperMaticTenantSettings>

The tenant kept.

DeleteTenantAsync ​

Removes a tenant kept by DapperMatic.

csharp
Task DeleteTenantAsync(
    DapperMaticOperation context,
    string id,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • id (string) - The tenant's id.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task

A task.

ExportAsync ​

Exports the policies and tenants kept by DapperMatic that the caller may manage.

csharp
Task&lt;DapperMaticAccessDocument&gt; ExportAsync(
    DapperMaticOperation context,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<DapperMaticAccessDocument>

The policies and tenants.

ImportAsync ​

Imports policies and tenants: every one is checked before any is kept. Importing needs access management for every datasource and schema.

csharp
Task ImportAsync(
    DapperMaticOperation context,
    DapperMaticAccessDocument document,
    bool replace,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • document (DapperMaticAccessDocument) - The policies and tenants.
  • replace (bool) - Whether they replace everything kept; otherwise they are added, replacing those of the same names.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task

A task.

GetEffectiveAsync ​

Works out what the policies let the caller do to a datasource, schema, table or view: for a user interface to show what is possible, or an administrator to see why something is refused. The conditions and the policies' names are shown only to a caller who manages access to the resource.

csharp
Task&lt;DapperMaticEffectiveAccess&gt; GetEffectiveAsync(
    DapperMaticOperation context,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation, naming the resource.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<DapperMaticEffectiveAccess>

The rules for each action.

GetServiceAccountsAsync ​

Lists the service accounts the caller manages: a tenant administrator's, their tenant's.

csharp
Task&lt;IReadOnlyList&lt;DapperMaticServiceAccount&gt;&gt; GetServiceAccountsAsync(
    DapperMaticOperation context,
    string tenant,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • tenant (string) - A tenant whose accounts to list, or null for every one.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<IReadOnlyList<DapperMaticServiceAccount>>

The accounts: of code and configuration, and kept.

SaveServiceAccountAsync ​

Adds a service account, or replaces the kept one of the same name (and tenant). A tenant's administrator keeps their tenant's, giving only roles they hold or roles only their tenant's policies name, and no claims.

csharp
Task&lt;DapperMaticServiceAccount&gt; SaveServiceAccountAsync(
    DapperMaticOperation context,
    string name,
    DapperMaticServiceAccount account,
    string tenant,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • name (string) - The account's name.
  • account (DapperMaticServiceAccount) - The account.
  • tenant (string) - The tenant it is one of, or null for the application's.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<DapperMaticServiceAccount>

The account kept.

DeleteServiceAccountAsync ​

Removes a kept service account, and revokes its keys.

csharp
Task DeleteServiceAccountAsync(
    DapperMaticOperation context,
    string name,
    string tenant,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • name (string) - The account's name.
  • tenant (string) - The tenant it is one of, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task

A task.

CreateServiceKeyAsync ​

Makes a key for a service account: shown this once.

csharp
Task&lt;ApiKeyCreated&gt; CreateServiceKeyAsync(
    DapperMaticOperation context,
    string name,
    ApiKeyRequest request,
    string tenant,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • name (string) - The account's name.
  • request (ApiKeyRequest) - The key's name, expiry and limits.
  • tenant (string) - The tenant the account is one of, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<ApiKeyCreated>

The key, and what is kept of it.

GetKeysAsync ​

Lists keys the caller manages, without their secrets: every one, or a tenant administrator's tenant's.

csharp
Task&lt;IReadOnlyList&lt;ApiKeyInfo&gt;&gt; GetKeysAsync(
    DapperMaticOperation context,
    DapperMaticKeyFilter filter,
    CancellationToken cancellationToken)

Parameters ​

Returns ​

Type: Task<IReadOnlyList<ApiKeyInfo>>

The keys.

RevokeKeyAsync ​

Revokes a key the caller manages: it no longer signs in, and is still listed.

csharp
Task RevokeKeyAsync(
    DapperMaticOperation context,
    string id,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • id (string) - The key's id.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task

A task.

GetOwnKeysAsync ​

Lists the caller's own personal keys.

csharp
Task&lt;IReadOnlyList&lt;ApiKeyInfo&gt;&gt; GetOwnKeysAsync(
    DapperMaticOperation context,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<IReadOnlyList<ApiKeyInfo>>

The keys.

CreateOwnKeyAsync ​

Makes a personal key for the caller, in their tenant: it acts as them, as they are each time it is used, never more. Shown this once.

csharp
Task&lt;ApiKeyCreated&gt; CreateOwnKeyAsync(
    DapperMaticOperation context,
    ApiKeyRequest request,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • request (ApiKeyRequest) - The key's name, expiry and limits.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<ApiKeyCreated>

The key, and what is kept of it.

RevokeOwnKeysAsync ​

Revokes one of the caller's personal keys, or every one.

csharp
Task&lt;int&gt; RevokeOwnKeysAsync(
    DapperMaticOperation context,
    string id,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • id (string) - The key's id, or null for every one.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task&lt;int&gt;

How many were revoked.

GetWebhooksAsync ​

Lists the webhooks the caller may manage, their secrets masked: of code and configuration, and kept. A tenant's administrator sees their tenant's.

csharp
Task&lt;IReadOnlyList&lt;DapperMaticWebhook&gt;&gt; GetWebhooksAsync(
    DapperMaticOperation context,
    string tenant,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • tenant (string) - A tenant whose webhooks to list, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<IReadOnlyList<DapperMaticWebhook>>

The webhooks.

GetWebhookAsync ​

Gets a webhook by its name, its secret masked.

csharp
Task&lt;DapperMaticWebhook&gt; GetWebhookAsync(
    DapperMaticOperation context,
    string name,
    string tenant,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • name (string) - The webhook's name.
  • tenant (string) - The tenant it is one of, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<DapperMaticWebhook>

The webhook.

SaveWebhookAsync ​

Adds a webhook to those kept, or replaces the kept one of the same name (and tenant); a secret left out, or masked, keeps the one kept. A tenant's administrator keeps their tenant's: it names its datasource and the tables, each one the administrator may read, and hears only the tenant's changes. Its address may not be an internal one unless the options allow it.

csharp
Task&lt;DapperMaticWebhook&gt; SaveWebhookAsync(
    DapperMaticOperation context,
    string name,
    DapperMaticWebhook webhook,
    string tenant,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • name (string) - The webhook's name.
  • webhook (DapperMaticWebhook) - The webhook.
  • tenant (string) - The tenant it is one of, or null for the application's.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<DapperMaticWebhook>

The webhook kept, its secret masked.

DeleteWebhookAsync ​

Removes a webhook kept by DapperMatic.

csharp
Task DeleteWebhookAsync(
    DapperMaticOperation context,
    string name,
    string tenant,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • name (string) - The webhook's name.
  • tenant (string) - The tenant it is one of, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task

A task.

GetWebhookStatusAsync ​

Reads where a webhook's messages have got to, in each datasource it hears: the messages taken and dropped, the attempts at the one waiting, and its last error.

csharp
Task&lt;IReadOnlyDictionary&lt;string, DapperMaticWebhookStatus&gt;&gt; GetWebhookStatusAsync(
    DapperMaticOperation context,
    string name,
    string tenant,
    CancellationToken cancellationToken)

Parameters ​

  • context (DapperMaticOperation) - The operation.
  • name (string) - The webhook's name.
  • tenant (string) - The tenant it is one of, or null.
  • cancellationToken (CancellationToken) - The cancellation token.

Returns ​

Type: Task<IReadOnlyDictionary<string, DapperMaticWebhookStatus>>

Its state in each datasource, by datasource.

GetType ​

csharp
GetType()

ToString ​

csharp
ToString()

Equals ​

csharp
Equals()

GetHashCode ​

csharp
GetHashCode()