AddNatsEventBus Method
Definition
- Namespace
- Savvyio.Extensions.DependencyInjection.NATS
- Assemblies
- Savvyio.Extensions.DependencyInjection.NATS.dll
AddNatsEventBus(IServiceCollection, Action<NatsEventBusOptions>, Action<ServiceOptions>)
Adds an NatsEventBus implementation to the specified IServiceCollection.
public static IServiceCollection AddNatsEventBus(this IServiceCollection services, Action<NatsEventBusOptions> natsSetup, Action<ServiceOptions> serviceSetup = null)
Parameters
servicesIServiceCollectionThe IServiceCollection to extend.
natsSetupAction<NatsEventBusOptions>The NatsEventBusOptions that needs to be configured.
serviceSetupAction<ServiceOptions>The ServiceOptions which may be configured.
Returns
- IServiceCollection
A reference to
servicesso that additional calls can be chained.
Remarks
The implementation will be type forwarded accordingly.
Exceptions
- ArgumentNullException
servicescannot be null.
AddNatsEventBus<TMarker>(IServiceCollection, Action<NatsEventBusOptions<TMarker>>, Action<ServiceOptions>)
Adds an NatsEventBus<TMarker> implementation to the specified IServiceCollection.
public static IServiceCollection AddNatsEventBus<TMarker>(this IServiceCollection services, Action<NatsEventBusOptions<TMarker>> natsSetup, Action<ServiceOptions> serviceSetup = null)
Parameters
servicesIServiceCollectionThe IServiceCollection to extend.
natsSetupAction<NatsEventBusOptions<TMarker>>The NatsEventBusOptions<TMarker> that needs to be configured.
serviceSetupAction<ServiceOptions>The ServiceOptions which may be configured.
Returns
- IServiceCollection
A reference to
servicesso that additional calls can be chained.
Type Parameters
TMarker
Remarks
The implementation will be type forwarded accordingly.
Exceptions
- ArgumentNullException
servicescannot be null.