Class RedbRouteExtensions

Assembly: redb.Route.Core.dll

Extension methods for accessing from route pipeline.
Provides typed integration points: Process, SetBody, SetHeader with (IRedbService, IExchange).
When exchange has a DI scope (), a scoped
is resolved per exchange; otherwise falls back to the route context singleton.

public static class RedbRouteExtensions

Inheritance

Object→RedbRouteExtensions

Methods

CreateRedbScope(IRouteContext, string?)

Opens a scope with its own , for code that runs without an exchange and may run in

public static RedbScope CreateRedbScope(this IRouteContext context, string? name = null)

GetRedbService(IRouteContext, string, IExchange?)

Resolves a named .

public static IRedbService GetRedbService(this IRouteContext context, string name, IExchange? exchange = null)

GetRedbService(IRouteContext)

Resolves the default from context service locator → DI fallback.

public static IRedbService GetRedbService(this IRouteContext context)

ProcessWithRedb(IRouteDefinition, Action<IRedbService, IExchange>)

Processes the exchange with access to (sync).

public static IRouteDefinition ProcessWithRedb(this IRouteDefinition route, Action<IRedbService, IExchange> action)

ProcessWithRedb(IRouteDefinition, Func<IRedbService, IExchange, CancellationToken, Task>)

Processes the exchange with access to (async).

public static IRouteDefinition ProcessWithRedb(this IRouteDefinition route, Func<IRedbService, IExchange, CancellationToken, Task> action)

ProcessWithRedb(IRouteDefinition, string, Action<IRedbService, IExchange>)

Processes the exchange with access to a named (sync).

public static IRouteDefinition ProcessWithRedb(this IRouteDefinition route, string name, Action<IRedbService, IExchange> action)

ProcessWithRedb(IRouteDefinition, string, Func<IRedbService, IExchange, CancellationToken, Task>)

Processes the exchange with access to a named (async).

public static IRouteDefinition ProcessWithRedb(this IRouteDefinition route, string name, Func<IRedbService, IExchange, CancellationToken, Task> action)

Redb(RedbController)

Resolves a PER-REQUEST scoped for a controller — its own DB

public static IRedbService Redb(this RedbController controller)

RegisterRedbService(IRouteContext, string, IRedbService)

Registers a named in the context registry.

public static IRouteContext RegisterRedbService(this IRouteContext context, string name, IRedbService redbService)

SetBodyFromRedb(IRouteDefinition, Func<IRedbService, IExchange, object?>)

Sets the exchange body using .

public static IRouteDefinition SetBodyFromRedb(this IRouteDefinition route, Func<IRedbService, IExchange, object?> factory)

SetBodyFromRedb(IRouteDefinition, string, Func<IRedbService, IExchange, object?>)

Sets the exchange body using a named .

public static IRouteDefinition SetBodyFromRedb(this IRouteDefinition route, string name, Func<IRedbService, IExchange, object?> factory)

SetHeaderFromRedb(IRouteDefinition, string, Func<IRedbService, IExchange, object?>)

Sets a header using .

public static IRouteDefinition SetHeaderFromRedb(this IRouteDefinition route, string headerName, Func<IRedbService, IExchange, object?> factory)

SetHeaderFromRedb(IRouteDefinition, string, string, Func<IRedbService, IExchange, object?>)

Sets a header using a named .

public static IRouteDefinition SetHeaderFromRedb(this IRouteDefinition route, string name, string headerName, Func<IRedbService, IExchange, object?> factory)