Class ServiceCollectionExtensions
- Namespace
- Savvyio.Extensions.DependencyInjection.Messaging
- Assembly
- Savvyio.Extensions.DependencyInjection.dll
Extension methods for the IServiceCollection interface.
public static class ServiceCollectionExtensions
- Inheritance
-
ServiceCollectionExtensions
Methods
AddMessageBus<TService, TRequest>(IServiceCollection, Action<ServiceOptions>)
Adds an implementation of IPublishSubscribeChannel<TRequest> to the specified IServiceCollection.
public static IServiceCollection AddMessageBus<TService, TRequest>(this IServiceCollection services, Action<ServiceOptions> setup = null) where TService : class, IPublishSubscribeChannel<TRequest> where TRequest : IRequest
Parameters
servicesIServiceCollectionThe IServiceCollection to add the service to.
setupAction<ServiceOptions>The ServiceOptions which may be configured.
Returns
- IServiceCollection
A reference to
servicesso that additional configuration calls can be chained.
Type Parameters
TServiceThe type of the IPublishSubscribeChannel<TRequest> to add.
TRequestThe type of the model to invoke on a handler.
Remarks
If the underlying type of TService implements IDependencyInjectionMarker<TMarker> interface then this is automatically handled. Also, the implementation will be type forwarded accordingly.
- See Also
-
IPublishSubscribeChannel<TRequest>IPublishSubscribeChannel<TRequest, TMarker>
AddMessageQueue<TService, TRequest>(IServiceCollection, Action<ServiceOptions>)
Adds an implementation of IPointToPointChannel<TRequest> to the specified IServiceCollection.
public static IServiceCollection AddMessageQueue<TService, TRequest>(this IServiceCollection services, Action<ServiceOptions> setup = null) where TService : class, IPointToPointChannel<TRequest> where TRequest : IRequest
Parameters
servicesIServiceCollectionThe IServiceCollection to add the service to.
setupAction<ServiceOptions>The ServiceOptions which may be configured.
Returns
- IServiceCollection
A reference to
servicesso that additional configuration calls can be chained.
Type Parameters
TServiceThe type of the IPointToPointChannel<TRequest> to add.
TRequestThe type of the model to invoke on a handler.
Remarks
If the underlying type of TService implements IDependencyInjectionMarker<TMarker> interface then this is automatically handled. Also, the implementation will be type forwarded accordingly.
- See Also
-
IPointToPointChannel<TRequest>IPointToPointChannel<TRequest, TMarker>