Class ResolvedAuthorizationHop
Describes a single hop in an indirect authorization chain.
public sealed class ResolvedAuthorizationHop
- Inheritance
-
ResolvedAuthorizationHop
- Inherited Members
- Extension Methods
Constructors
ResolvedAuthorizationHop(Type, Type, Type, Func<object, IReadOnlyList<object>>, Func<IServiceProvider, object, CancellationToken, Task<HopLoadResult>>, bool)
Creates a new resolved hop.
public ResolvedAuthorizationHop(Type fromType, Type toType, Type toIdType, Func<object, IReadOnlyList<object>> extractIds, Func<IServiceProvider, object, CancellationToken, Task<HopLoadResult>> loadAsync, bool isPlural)
Parameters
fromTypeTypeThe CLR type of the resources this hop starts from.
toTypeTypeThe CLR type of the resources this hop loads.
toIdTypeTypeThe CLR type of the identifier used to load
toType.extractIdsFunc<object, IReadOnlyList<object>>Delegate that, given an instance of
fromType, returns the related resource IDs of typetoIdType. For singular hops, returns a list of size 0 or 1; for plural hops, returns 0..N IDs.loadAsyncFunc<IServiceProvider, object, CancellationToken, Task<HopLoadResult>>Delegate that loads a single related resource by ID from the request-scoped service provider. Built at registration time so the runtime behavior remains AOT-clean.
isPluralbooltruewhen this hop is plural (the source declares IIdentifyRelatedResources<TRelated, TId>);falsewhen singular.
Properties
ExtractIds
Gets the delegate that extracts related-resource IDs from a single source instance.
public Func<object, IReadOnlyList<object>> ExtractIds { get; }
Property Value
FromType
Gets the CLR type of the resources this hop starts from.
public Type FromType { get; }
Property Value
IsPlural
Gets a value indicating whether this hop is plural (fan-out). Only the terminal hop may be plural.
public bool IsPlural { get; }
Property Value
LoadAsync
Gets the delegate that loads one resource by ID from the request-scoped service provider.
public Func<IServiceProvider, object, CancellationToken, Task<HopLoadResult>> LoadAsync { get; }
Property Value
ToIdType
Gets the CLR type of the identifier used to load ToType.
public Type ToIdType { get; }
Property Value
ToType
Gets the CLR type of the resources this hop loads.
public Type ToType { get; }