Table of Contents

Class ResolvedAuthorizationPathHolder<TMessage, TLeaf, TOwner, TResponse>

Namespace
Trellis.Mediator
Assembly
Trellis.Mediator.dll

Closed-generic carrier for a ResolvedAuthorizationPath registered per via-authorized command. Used so DI naturally disambiguates the path per command (each closed generic is a distinct service type) and so ResourceAuthorizationViaBehavior<TMessage, TLeaf, TOwner, TResponse> can be registered as a TYPED descriptor (not a factory descriptor), letting ServiceCollectionExtensions's relocator recognize it by ImplementationType alone.

public sealed class ResolvedAuthorizationPathHolder<TMessage, TLeaf, TOwner, TResponse>

Type Parameters

TMessage

The command type.

TLeaf

The leaf resource type.

TOwner

The owner resource type.

TResponse

The response type.

Inheritance
ResolvedAuthorizationPathHolder<TMessage, TLeaf, TOwner, TResponse>
Inherited Members
Extension Methods

Constructors

ResolvedAuthorizationPathHolder(ResolvedAuthorizationPath)

Creates a new holder for the resolved path.

public ResolvedAuthorizationPathHolder(ResolvedAuthorizationPath path)

Parameters

path ResolvedAuthorizationPath

The pre-built path. Must not be null, and its MessageType, LeafType, and OwnerType must equal TMessage, TLeaf, and TOwner.

Exceptions

ArgumentNullException

Thrown when path is null.

ArgumentException

Thrown when path's MessageType, LeafType, or OwnerType does not equal the corresponding holder generic argument. Validating here makes misconfiguration fail fast at registration (the holder is constructed eagerly by AddRelatedResourceAuthorization(..., ResolvedAuthorizationPath) and by the assembly scanner) rather than at first request when ResourceAuthorizationViaBehavior<TMessage, TLeaf, TOwner, TResponse> would otherwise re-detect the mismatch.

Properties

Path

Gets the resolved authorization path.

public ResolvedAuthorizationPath Path { get; }

Property Value

ResolvedAuthorizationPath