Table of Contents

Class TenantSelectQueryBehavior<TKey, TEntityModel>

Namespace
Arbiter.CommandQuery.Behaviors
Assembly
Arbiter.CommandQuery.dll

A behavior for appending tenant filter to a select query.

public class TenantSelectQueryBehavior<TKey, TEntityModel> : TenantFilterBehaviorBase<TKey, TEntityModel, EntitySelectQuery<TEntityModel>, IReadOnlyCollection<TEntityModel>>, IPipelineBehavior<EntitySelectQuery<TEntityModel>, IReadOnlyCollection<TEntityModel>> where TEntityModel : class

Type Parameters

TKey

The type of the model key

TEntityModel

The type of the model

Inheritance
TenantFilterBehaviorBase<TKey, TEntityModel, EntitySelectQuery<TEntityModel>, IReadOnlyCollection<TEntityModel>>
TenantSelectQueryBehavior<TKey, TEntityModel>
Implements
Inherited Members

Constructors

TenantSelectQueryBehavior(ILoggerFactory, ITenantResolver<TKey>)

Initializes a new instance of the TenantSelectQueryBehavior<TKey, TEntityModel> class.

public TenantSelectQueryBehavior(ILoggerFactory loggerFactory, ITenantResolver<TKey> tenantResolver)

Parameters

loggerFactory ILoggerFactory

The logger factory to create an ILogger from

tenantResolver ITenantResolver<TKey>

The tenant resolver service.

Exceptions

ArgumentNullException

Methods

Process(EntitySelectQuery<TEntityModel>, RequestHandlerDelegate<IReadOnlyCollection<TEntityModel>>, CancellationToken)

Processes the specified request with the additional behavior.

protected override ValueTask<IReadOnlyCollection<TEntityModel>?> Process(EntitySelectQuery<TEntityModel> request, RequestHandlerDelegate<IReadOnlyCollection<TEntityModel>> next, CancellationToken cancellationToken)

Parameters

request EntitySelectQuery<TEntityModel>

The incoming request.

next RequestHandlerDelegate<IReadOnlyCollection<TEntityModel>>

Awaitable delegate for the next action in the pipeline. Eventually this delegate represents the handler.

cancellationToken CancellationToken

The cancellation token.

Returns

ValueTask<IReadOnlyCollection<TEntityModel>>

Awaitable task returning the System.Collections.Generic.IReadOnlyCollection{`1}