Table of Contents

Class InvitationThrottleRegistration

Namespace
Tharga.Team.Service
Assembly
Tharga.Team.Service.dll

Wraps the registered ITeamInvitationService so repeated failed resolves from one source are delayed and the first crossing is audited.

public static class InvitationThrottleRegistration
Inheritance
InvitationThrottleRegistration
Inherited Members

Methods

AddInvitationThrottle(IServiceCollection)

Decorates ITeamInvitationService with the throttle. Does nothing when no invitation service is registered.

public static IServiceCollection AddInvitationThrottle(this IServiceCollection services)

Parameters

services IServiceCollection

Returns

IServiceCollection

Remarks

Registered from this package rather than from the Blazor one, because the types are internal here and a library owns registering its own services. The caller only has to say when — after the facet it decorates exists.

Decorating by replacing the descriptor, not by ordering. The facets are registered with TryAdd, so a decorator added first would simply win and the inner service would never be built; and one added last without removing the original would be shadowed by it. Taking the existing descriptor out and re-registering around it is what makes this independent of when it is called.