Method GetRedbService(IRouteContext, string, IExchange?)

Assembly: redb.Route.Core.dll

Resolves a named .

Scoping model for named instances:
Named IRedbService is stateful (like EF DbContext) and must NOT be shared across
concurrent exchanges. When exchange is provided, a per-exchange
scoped instance is created from the registered
(placed in registry by TsakContextManager under "redb-factory:{name}" key).
The scope is cached in and auto-disposed when
the exchange completes ().


Resolution priority:
Cached scope in exchange.Properties (same exchange, second call)New scope from factory in registry (first call with exchange)New scope opened from the registered instance through (first call with exchange,
no factory: a host outside Tsak whose instance was built through a container)Singleton fallback from registry (no exchange, or an instance built without a container)

Falls back to the default (unnamed) service if the name is null or empty.

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