Class ResolvedAuthorizationPathHolder<TMessage, TLeaf, TOwner, TResponse>
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
TMessageThe command type.
TLeafThe leaf resource type.
TOwnerThe owner resource type.
TResponseThe 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
pathResolvedAuthorizationPathThe pre-built path. Must not be null, and its MessageType, LeafType, and OwnerType must equal
TMessage,TLeaf, andTOwner.
Exceptions
- ArgumentNullException
Thrown when
pathis 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 byAddRelatedResourceAuthorization(..., 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; }