Table of Contents

Class AsiBackboneAspNetCoreServiceCollectionExtensions

Namespace
AsiBackbone.AspNetCore.DependencyInjection
Assembly
AsiBackbone.AspNetCore.dll

Provides dependency injection registration helpers for ASP.NET Core host integration.

public static class AsiBackboneAspNetCoreServiceCollectionExtensions
Inheritance
AsiBackboneAspNetCoreServiceCollectionExtensions
Inherited Members

Methods

AddAsiBackboneAspNetCore(IServiceCollection)

Adds ASP.NET Core integration services for AsiBackbone using default options.

public static IServiceCollection AddAsiBackboneAspNetCore(this IServiceCollection services)

Parameters

services IServiceCollection

The service collection to add services to.

Returns

IServiceCollection

The same service collection so calls can be chained.

AddAsiBackboneAspNetCore(IServiceCollection, Action<AspNetCoreGovernanceOptions>)

Adds ASP.NET Core integration services for AsiBackbone using configured options.

public static IServiceCollection AddAsiBackboneAspNetCore(this IServiceCollection services, Action<AspNetCoreGovernanceOptions> configure)

Parameters

services IServiceCollection

The service collection to add services to.

configure Action<AspNetCoreGovernanceOptions>

The options configuration callback.

Returns

IServiceCollection

The same service collection so calls can be chained.

Remarks

Option validation is deferred to the Microsoft.Extensions.Options pipeline. Invalid option values are reported as OptionsValidationException when Value is resolved or during host startup when ValidateOnStart executes.

Exceptions

ArgumentNullException

Thrown when services or configure is null.

AddAsiBackboneGovernanceOutboxDrainWorker(IServiceCollection)

Adds the host-owned outbox drain worker using default scheduling options.

public static IServiceCollection AddAsiBackboneGovernanceOutboxDrainWorker(this IServiceCollection services)

Parameters

services IServiceCollection

The service collection to add services to.

Returns

IServiceCollection

The same service collection so calls can be chained.

Remarks

The worker is local to the process in which it is registered, so every replica of a horizontally scaled host runs its own worker against the same durable outbox. Coordination before provider emission comes from UseClaimLeases, which is enabled by default and requires a store implementing IGovernanceOutboxClaimStore; the drain throws when it is enabled against a store that cannot claim. Disabling it allows two replicas to select and emit the same envelope, so a host that opts out should partition work, run the worker on a single role, or rely on provider-side idempotency. Claiming coordinates workers; it does not by itself create an exactly-once delivery guarantee.

AddAsiBackboneGovernanceOutboxDrainWorker(IServiceCollection, Action<GovernanceOutboxDrainWorkerOptions>)

Adds the host-owned outbox drain worker using configured scheduling options.

public static IServiceCollection AddAsiBackboneGovernanceOutboxDrainWorker(this IServiceCollection services, Action<GovernanceOutboxDrainWorkerOptions> configure)

Parameters

services IServiceCollection

The service collection to add services to.

configure Action<GovernanceOutboxDrainWorkerOptions>

The worker options configuration callback.

Returns

IServiceCollection

The same service collection so calls can be chained.

Remarks

The worker is local to the process in which it is registered, so every replica of a horizontally scaled host runs its own worker against the same durable outbox. Coordination before provider emission comes from UseClaimLeases, which is enabled by default and requires a store implementing IGovernanceOutboxClaimStore; the drain throws when it is enabled against a store that cannot claim. Disabling it allows two replicas to select and emit the same envelope, so a host that opts out should partition work, run the worker on a single role, or rely on provider-side idempotency. Claiming coordinates workers; it does not by itself create an exactly-once delivery guarantee.

Validation of configure values is deferred to the options pipeline. Invalid values are reported as OptionsValidationException when options are resolved, including hosted-service startup validation through CurrentValue.

Exceptions

ArgumentNullException

Thrown when services or configure is null.