Class SilverbackBuilder
- Namespace
- Silverback.Configuration
- Assembly
- Silverback.Core.dll
Exposes the methods to configure Silverback and enable its optional features adding the necessary services to the IServiceCollection.
public class SilverbackBuilder
- Inheritance
-
SilverbackBuilder
- Inherited Members
Constructors
SilverbackBuilder(IServiceCollection)
Initializes a new instance of the SilverbackBuilder class.
public SilverbackBuilder(IServiceCollection services)
Parameters
servicesIServiceCollectionThe IServiceCollection to be wrapped.
Properties
BusOptions
Gets the BusOptions.
public BusOptions BusOptions { get; }
Property Value
Services
Gets the wrapped IServiceCollection.
public IServiceCollection Services { get; }
Property Value
Methods
AddDelegateSubscriber<TMessage>(Action<TMessage>, DelegateSubscriptionOptions?)
Subscribes the specified delegate to the messages being published into the bus.
public SilverbackBuilder AddDelegateSubscriber<TMessage>(Action<TMessage> handler, DelegateSubscriptionOptions? options = null)
Parameters
handlerAction<TMessage>The message handler delegate.
optionsDelegateSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TMessageThe type of the messages to be handled.
AddDelegateSubscriber<TMessage>(Func<TMessage, Task>, DelegateSubscriptionOptions?)
Subscribes the specified delegate to the messages being published into the bus.
public SilverbackBuilder AddDelegateSubscriber<TMessage>(Func<TMessage, Task> handler, DelegateSubscriptionOptions? options = null)
Parameters
handlerFunc<TMessage, Task>The message handler delegate.
optionsDelegateSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TMessageThe type of the messages to be handled.
AddDelegateSubscriber<TMessage>(Func<TMessage, ValueTask>, DelegateSubscriptionOptions?)
Subscribes the specified delegate to the messages being published into the bus.
public SilverbackBuilder AddDelegateSubscriber<TMessage>(Func<TMessage, ValueTask> handler, DelegateSubscriptionOptions? options = null)
Parameters
handlerFunc<TMessage, ValueTask>The message handler delegate.
optionsDelegateSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TMessageThe type of the messages to be handled.
AddDelegateSubscriber<TMessage, T2>(Action<TMessage, T2>, DelegateSubscriptionOptions?)
Subscribes the specified delegate to the messages being published into the bus.
public SilverbackBuilder AddDelegateSubscriber<TMessage, T2>(Action<TMessage, T2> handler, DelegateSubscriptionOptions? options = null)
Parameters
handlerAction<TMessage, T2>The message handler delegate.
optionsDelegateSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TMessageThe type of the messages to be handled.
T2The type of an additional service to be resolved and passed to the method.
AddDelegateSubscriber<TMessage, TResult>(Func<TMessage, Task<TResult>>, DelegateSubscriptionOptions?)
Subscribes the specified delegate to the messages being published into the bus.
public SilverbackBuilder AddDelegateSubscriber<TMessage, TResult>(Func<TMessage, Task<TResult>> handler, DelegateSubscriptionOptions? options = null)
Parameters
handlerFunc<TMessage, Task<TResult>>The message handler delegate.
optionsDelegateSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TMessageThe type of the messages to be handled.
TResultThe type of the result returned by the handler.
AddDelegateSubscriber<TMessage, TResult>(Func<TMessage, ValueTask<TResult>>, DelegateSubscriptionOptions?)
Subscribes the specified delegate to the messages being published into the bus.
public SilverbackBuilder AddDelegateSubscriber<TMessage, TResult>(Func<TMessage, ValueTask<TResult>> handler, DelegateSubscriptionOptions? options = null)
Parameters
handlerFunc<TMessage, ValueTask<TResult>>The message handler delegate.
optionsDelegateSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TMessageThe type of the messages to be handled.
TResultThe type of the result returned by the handler.
AddDelegateSubscriber<TMessage, T2>(Func<TMessage, T2, Task>, DelegateSubscriptionOptions?)
Subscribes the specified delegate to the messages being published into the bus.
public SilverbackBuilder AddDelegateSubscriber<TMessage, T2>(Func<TMessage, T2, Task> handler, DelegateSubscriptionOptions? options = null)
Parameters
handlerFunc<TMessage, T2, Task>The message handler delegate.
optionsDelegateSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TMessageThe type of the messages to be handled.
T2The type of an additional service to be resolved and passed to the method.
AddDelegateSubscriber<TMessage, T2>(Func<TMessage, T2, ValueTask>, DelegateSubscriptionOptions?)
Subscribes the specified delegate to the messages being published into the bus.
public SilverbackBuilder AddDelegateSubscriber<TMessage, T2>(Func<TMessage, T2, ValueTask> handler, DelegateSubscriptionOptions? options = null)
Parameters
handlerFunc<TMessage, T2, ValueTask>The message handler delegate.
optionsDelegateSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TMessageThe type of the messages to be handled.
T2The type of an additional service to be resolved and passed to the method.
AddDelegateSubscriber<TMessage, TResult>(Func<TMessage, TResult>, DelegateSubscriptionOptions?)
Subscribes the specified delegate to the messages being published into the bus.
public SilverbackBuilder AddDelegateSubscriber<TMessage, TResult>(Func<TMessage, TResult> handler, DelegateSubscriptionOptions? options = null)
Parameters
handlerFunc<TMessage, TResult>The message handler delegate.
optionsDelegateSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TMessageThe type of the messages to be handled.
TResultThe type of the result returned by the handler.
AddDelegateSubscriber<TMessage, T2, T3>(Action<TMessage, T2, T3>, DelegateSubscriptionOptions?)
Subscribes the specified delegate to the messages being published into the bus.
public SilverbackBuilder AddDelegateSubscriber<TMessage, T2, T3>(Action<TMessage, T2, T3> handler, DelegateSubscriptionOptions? options = null)
Parameters
handlerAction<TMessage, T2, T3>The message handler delegate.
optionsDelegateSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TMessageThe type of the messages to be handled.
T2The type of an additional service to be resolved and passed to the method.
T3The type of an additional service to be resolved and passed to the method.
AddDelegateSubscriber<TMessage, T2, TResult>(Func<TMessage, T2, Task<TResult>>, DelegateSubscriptionOptions?)
Subscribes the specified delegate to the messages being published into the bus.
public SilverbackBuilder AddDelegateSubscriber<TMessage, T2, TResult>(Func<TMessage, T2, Task<TResult>> handler, DelegateSubscriptionOptions? options = null)
Parameters
handlerFunc<TMessage, T2, Task<TResult>>The message handler delegate.
optionsDelegateSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TMessageThe type of the messages to be handled.
T2The type of an additional service to be resolved and passed to the method.
TResultThe type of the result returned by the handler.
AddDelegateSubscriber<TMessage, T2, TResult>(Func<TMessage, T2, ValueTask<TResult>>, DelegateSubscriptionOptions?)
Subscribes the specified delegate to the messages being published into the bus.
public SilverbackBuilder AddDelegateSubscriber<TMessage, T2, TResult>(Func<TMessage, T2, ValueTask<TResult>> handler, DelegateSubscriptionOptions? options = null)
Parameters
handlerFunc<TMessage, T2, ValueTask<TResult>>The message handler delegate.
optionsDelegateSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TMessageThe type of the messages to be handled.
T2The type of an additional service to be resolved and passed to the method.
TResultThe type of the result returned by the handler.
AddDelegateSubscriber<TMessage, T2, T3>(Func<TMessage, T2, T3, Task>, DelegateSubscriptionOptions?)
Subscribes the specified delegate to the messages being published into the bus.
public SilverbackBuilder AddDelegateSubscriber<TMessage, T2, T3>(Func<TMessage, T2, T3, Task> handler, DelegateSubscriptionOptions? options = null)
Parameters
handlerFunc<TMessage, T2, T3, Task>The message handler delegate.
optionsDelegateSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TMessageThe type of the messages to be handled.
T2The type of an additional service to be resolved and passed to the method.
T3The type of an additional service to be resolved and passed to the method.
AddDelegateSubscriber<TMessage, T2, T3>(Func<TMessage, T2, T3, ValueTask>, DelegateSubscriptionOptions?)
Subscribes the specified delegate to the messages being published into the bus.
public SilverbackBuilder AddDelegateSubscriber<TMessage, T2, T3>(Func<TMessage, T2, T3, ValueTask> handler, DelegateSubscriptionOptions? options = null)
Parameters
handlerFunc<TMessage, T2, T3, ValueTask>The message handler delegate.
optionsDelegateSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TMessageThe type of the messages to be handled.
T2The type of an additional service to be resolved and passed to the method.
T3The type of an additional service to be resolved and passed to the method.
AddDelegateSubscriber<TMessage, T2, TResult>(Func<TMessage, T2, TResult>, DelegateSubscriptionOptions?)
Subscribes the specified delegate to the messages being published into the bus.
public SilverbackBuilder AddDelegateSubscriber<TMessage, T2, TResult>(Func<TMessage, T2, TResult> handler, DelegateSubscriptionOptions? options = null)
Parameters
handlerFunc<TMessage, T2, TResult>The message handler delegate.
optionsDelegateSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TMessageThe type of the messages to be handled.
T2The type of an additional service to be resolved and passed to the method.
TResultThe type of the result returned by the handler.
AddDelegateSubscriber<TMessage, T2, T3, T4>(Action<TMessage, T2, T3, T4>, DelegateSubscriptionOptions?)
Subscribes the specified delegate to the messages being published into the bus.
public SilverbackBuilder AddDelegateSubscriber<TMessage, T2, T3, T4>(Action<TMessage, T2, T3, T4> handler, DelegateSubscriptionOptions? options = null)
Parameters
handlerAction<TMessage, T2, T3, T4>The message handler delegate.
optionsDelegateSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TMessageThe type of the messages to be handled.
T2The type of an additional service to be resolved and passed to the method.
T3The type of an additional service to be resolved and passed to the method.
T4The type of an additional service to be resolved and passed to the method.
AddDelegateSubscriber<TMessage, T2, T3, TResult>(Func<TMessage, T2, T3, Task<TResult>>, DelegateSubscriptionOptions?)
Subscribes the specified delegate to the messages being published into the bus.
public SilverbackBuilder AddDelegateSubscriber<TMessage, T2, T3, TResult>(Func<TMessage, T2, T3, Task<TResult>> handler, DelegateSubscriptionOptions? options = null)
Parameters
handlerFunc<TMessage, T2, T3, Task<TResult>>The message handler delegate.
optionsDelegateSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TMessageThe type of the messages to be handled.
T2The type of an additional service to be resolved and passed to the method.
T3The type of an additional service to be resolved and passed to the method.
TResultThe type of the result returned by the handler.
AddDelegateSubscriber<TMessage, T2, T3, TResult>(Func<TMessage, T2, T3, ValueTask<TResult>>, DelegateSubscriptionOptions?)
Subscribes the specified delegate to the messages being published into the bus.
public SilverbackBuilder AddDelegateSubscriber<TMessage, T2, T3, TResult>(Func<TMessage, T2, T3, ValueTask<TResult>> handler, DelegateSubscriptionOptions? options = null)
Parameters
handlerFunc<TMessage, T2, T3, ValueTask<TResult>>The message handler delegate.
optionsDelegateSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TMessageThe type of the messages to be handled.
T2The type of an additional service to be resolved and passed to the method.
T3The type of an additional service to be resolved and passed to the method.
TResultThe type of the result returned by the handler.
AddDelegateSubscriber<TMessage, T2, T3, T4>(Func<TMessage, T2, T3, T4, Task>, DelegateSubscriptionOptions?)
Subscribes the specified delegate to the messages being published into the bus.
public SilverbackBuilder AddDelegateSubscriber<TMessage, T2, T3, T4>(Func<TMessage, T2, T3, T4, Task> handler, DelegateSubscriptionOptions? options = null)
Parameters
handlerFunc<TMessage, T2, T3, T4, Task>The message handler delegate.
optionsDelegateSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TMessageThe type of the messages to be handled.
T2The type of an additional service to be resolved and passed to the method.
T3The type of an additional service to be resolved and passed to the method.
T4The type of an additional service to be resolved and passed to the method.
AddDelegateSubscriber<TMessage, T2, T3, T4>(Func<TMessage, T2, T3, T4, ValueTask>, DelegateSubscriptionOptions?)
Subscribes the specified delegate to the messages being published into the bus.
public SilverbackBuilder AddDelegateSubscriber<TMessage, T2, T3, T4>(Func<TMessage, T2, T3, T4, ValueTask> handler, DelegateSubscriptionOptions? options = null)
Parameters
handlerFunc<TMessage, T2, T3, T4, ValueTask>The message handler delegate.
optionsDelegateSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TMessageThe type of the messages to be handled.
T2The type of an additional service to be resolved and passed to the method.
T3The type of an additional service to be resolved and passed to the method.
T4The type of an additional service to be resolved and passed to the method.
AddDelegateSubscriber<TMessage, T2, T3, TResult>(Func<TMessage, T2, T3, TResult>, DelegateSubscriptionOptions?)
Subscribes the specified delegate to the messages being published into the bus.
public SilverbackBuilder AddDelegateSubscriber<TMessage, T2, T3, TResult>(Func<TMessage, T2, T3, TResult> handler, DelegateSubscriptionOptions? options = null)
Parameters
handlerFunc<TMessage, T2, T3, TResult>The message handler delegate.
optionsDelegateSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TMessageThe type of the messages to be handled.
T2The type of an additional service to be resolved and passed to the method.
T3The type of an additional service to be resolved and passed to the method.
TResultThe type of the result returned by the handler.
AddDelegateSubscriber<TMessage, T2, T3, T4, TResult>(Func<TMessage, T2, T3, T4, Task<TResult>>, DelegateSubscriptionOptions?)
Subscribes the specified delegate to the messages being published into the bus.
public SilverbackBuilder AddDelegateSubscriber<TMessage, T2, T3, T4, TResult>(Func<TMessage, T2, T3, T4, Task<TResult>> handler, DelegateSubscriptionOptions? options = null)
Parameters
handlerFunc<TMessage, T2, T3, T4, Task<TResult>>The message handler delegate.
optionsDelegateSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TMessageThe type of the messages to be handled.
T2The type of an additional service to be resolved and passed to the method.
T3The type of an additional service to be resolved and passed to the method.
T4The type of an additional service to be resolved and passed to the method.
TResultThe type of the result returned by the handler.
AddDelegateSubscriber<TMessage, T2, T3, T4, TResult>(Func<TMessage, T2, T3, T4, ValueTask<TResult>>, DelegateSubscriptionOptions?)
Subscribes the specified delegate to the messages being published into the bus.
public SilverbackBuilder AddDelegateSubscriber<TMessage, T2, T3, T4, TResult>(Func<TMessage, T2, T3, T4, ValueTask<TResult>> handler, DelegateSubscriptionOptions? options = null)
Parameters
handlerFunc<TMessage, T2, T3, T4, ValueTask<TResult>>The message handler delegate.
optionsDelegateSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TMessageThe type of the messages to be handled.
T2The type of an additional service to be resolved and passed to the method.
T3The type of an additional service to be resolved and passed to the method.
T4The type of an additional service to be resolved and passed to the method.
TResultThe type of the result returned by the handler.
AddDelegateSubscriber<TMessage, T2, T3, T4, TResult>(Func<TMessage, T2, T3, T4, TResult>, DelegateSubscriptionOptions?)
Subscribes the specified delegate to the messages being published into the bus.
public SilverbackBuilder AddDelegateSubscriber<TMessage, T2, T3, T4, TResult>(Func<TMessage, T2, T3, T4, TResult> handler, DelegateSubscriptionOptions? options = null)
Parameters
handlerFunc<TMessage, T2, T3, T4, TResult>The message handler delegate.
optionsDelegateSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TMessageThe type of the messages to be handled.
T2The type of an additional service to be resolved and passed to the method.
T3The type of an additional service to be resolved and passed to the method.
T4The type of an additional service to be resolved and passed to the method.
TResultThe type of the result returned by the handler.
AddScopedBehavior(Func<IServiceProvider, IBehavior>)
Adds a scoped behavior with a factory specified in implementationFactory to the
IServiceCollection.
public SilverbackBuilder AddScopedBehavior(Func<IServiceProvider, IBehavior> implementationFactory)
Parameters
implementationFactoryFunc<IServiceProvider, IBehavior>The factory that creates the service.
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
AddScopedBehavior(Type)
Adds a scoped behavior of the type specified in behaviorType to the
IServiceCollection.
public SilverbackBuilder AddScopedBehavior(Type behaviorType)
Parameters
behaviorTypeTypeThe type of the behavior to register and the implementation to use.
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
AddScopedBehavior<TBehavior>()
Adds a scoped behavior of the type specified in TBehavior to the
IServiceCollection.
public SilverbackBuilder AddScopedBehavior<TBehavior>() where TBehavior : class, IBehavior
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TBehaviorThe type of the behavior to add.
AddScopedSubscriber(Type, TypeSubscriptionOptions)
Adds a scoped subscriber of the type specified in subscriberType to the
IServiceCollection.
public SilverbackBuilder AddScopedSubscriber(Type subscriberType, TypeSubscriptionOptions options)
Parameters
subscriberTypeTypeThe type of the subscriber to register and the implementation to use.
optionsTypeSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
AddScopedSubscriber(Type, bool)
Adds a scoped subscriber of the type specified in subscriberType to the
IServiceCollection.
public SilverbackBuilder AddScopedSubscriber(Type subscriberType, bool autoSubscribeAllPublicMethods = true)
Parameters
subscriberTypeTypeThe type of the subscriber to register and the implementation to use.
autoSubscribeAllPublicMethodsboolA boolean value indicating whether all public methods of the specified type have to be automatically subscribed. When set to
falseonly the methods decorated with the SubscribeAttribute are subscribed.
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
AddScopedSubscriber(Type, Func<IServiceProvider, object>, TypeSubscriptionOptions)
Adds a scoped subscriber of the type specified in subscriberType with a factory
specified in implementationFactory to the IServiceCollection.
public SilverbackBuilder AddScopedSubscriber(Type subscriberType, Func<IServiceProvider, object> implementationFactory, TypeSubscriptionOptions options)
Parameters
subscriberTypeTypeThe type of the subscriber to register.
implementationFactoryFunc<IServiceProvider, object>The factory that creates the service.
optionsTypeSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
AddScopedSubscriber(Type, Func<IServiceProvider, object>, bool)
Adds a scoped subscriber of the type specified in subscriberType with a factory
specified in implementationFactory to the IServiceCollection.
public SilverbackBuilder AddScopedSubscriber(Type subscriberType, Func<IServiceProvider, object> implementationFactory, bool autoSubscribeAllPublicMethods = true)
Parameters
subscriberTypeTypeThe type of the subscriber to register.
implementationFactoryFunc<IServiceProvider, object>The factory that creates the service.
autoSubscribeAllPublicMethodsboolA boolean value indicating whether all public methods of the specified type have to be automatically subscribed. When set to
falseonly the methods decorated with the SubscribeAttribute are subscribed.
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
AddScopedSubscriber<TSubscriber>(TypeSubscriptionOptions)
Adds a scoped subscriber of the type specified in TSubscriber to the
IServiceCollection.
public SilverbackBuilder AddScopedSubscriber<TSubscriber>(TypeSubscriptionOptions options) where TSubscriber : class
Parameters
optionsTypeSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TSubscriberThe type of the subscriber to add.
AddScopedSubscriber<TSubscriber>(bool)
Adds a scoped subscriber of the type specified in TSubscriber to the
IServiceCollection.
public SilverbackBuilder AddScopedSubscriber<TSubscriber>(bool autoSubscribeAllPublicMethods = true) where TSubscriber : class
Parameters
autoSubscribeAllPublicMethodsboolA boolean value indicating whether all public methods of the specified type have to be automatically subscribed. When set to
falseonly the methods decorated with the SubscribeAttribute are subscribed.
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TSubscriberThe type of the subscriber to add.
AddScopedSubscriber<TSubscriber>(Func<IServiceProvider, TSubscriber>, TypeSubscriptionOptions)
Adds a scoped subscriber of the type specified in TSubscriber with a factory
specified in implementationFactory to the IServiceCollection.
public SilverbackBuilder AddScopedSubscriber<TSubscriber>(Func<IServiceProvider, TSubscriber> implementationFactory, TypeSubscriptionOptions options) where TSubscriber : class
Parameters
implementationFactoryFunc<IServiceProvider, TSubscriber>The factory that creates the service.
optionsTypeSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TSubscriberThe type of the subscriber to add.
AddScopedSubscriber<TSubscriber>(Func<IServiceProvider, TSubscriber>, bool)
Adds a scoped subscriber of the type specified in TSubscriber with a factory
specified in implementationFactory to the IServiceCollection.
public SilverbackBuilder AddScopedSubscriber<TSubscriber>(Func<IServiceProvider, TSubscriber> implementationFactory, bool autoSubscribeAllPublicMethods = true) where TSubscriber : class
Parameters
implementationFactoryFunc<IServiceProvider, TSubscriber>The factory that creates the service.
autoSubscribeAllPublicMethodsboolA boolean value indicating whether all public methods of the specified type have to be automatically subscribed. When set to
falseonly the methods decorated with the SubscribeAttribute are subscribed.
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TSubscriberThe type of the subscriber to add.
AddSingletonBehavior(IBehavior)
Adds a singleton behavior with an instance specified in implementationInstance
to the IServiceCollection.
public SilverbackBuilder AddSingletonBehavior(IBehavior implementationInstance)
Parameters
implementationInstanceIBehaviorThe instance of the service.
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
AddSingletonBehavior(Func<IServiceProvider, IBehavior>)
Adds a singleton behavior with a factory specified in implementationFactory to
the IServiceCollection.
public SilverbackBuilder AddSingletonBehavior(Func<IServiceProvider, IBehavior> implementationFactory)
Parameters
implementationFactoryFunc<IServiceProvider, IBehavior>The factory that creates the service.
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
AddSingletonBehavior(Type)
Adds a singleton behavior of the type specified in behaviorType to the
IServiceCollection.
public SilverbackBuilder AddSingletonBehavior(Type behaviorType)
Parameters
behaviorTypeTypeThe type of the behavior to register and the implementation to use.
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
AddSingletonBehavior<TBehavior>()
Adds a singleton behavior of the type specified in TBehavior to the
IServiceCollection.
public SilverbackBuilder AddSingletonBehavior<TBehavior>() where TBehavior : class, IBehavior
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TBehaviorThe type of the behavior to add.
AddSingletonSubscriber(Type, TypeSubscriptionOptions)
Adds a singleton subscriber of the type specified in subscriberType to the
IServiceCollection.
public SilverbackBuilder AddSingletonSubscriber(Type subscriberType, TypeSubscriptionOptions options)
Parameters
subscriberTypeTypeThe type of the subscriber to register and the implementation to use.
optionsTypeSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
AddSingletonSubscriber(Type, bool)
Adds a singleton subscriber of the type specified in subscriberType to the
IServiceCollection.
public SilverbackBuilder AddSingletonSubscriber(Type subscriberType, bool autoSubscribeAllPublicMethods = true)
Parameters
subscriberTypeTypeThe type of the subscriber to register and the implementation to use.
autoSubscribeAllPublicMethodsboolA boolean value indicating whether all public methods of the specified type have to be automatically subscribed. When set to
falseonly the methods decorated with the SubscribeAttribute are subscribed.
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
AddSingletonSubscriber(Type, Func<IServiceProvider, object>, TypeSubscriptionOptions)
Adds a singleton subscriber of the type specified in subscriberType with a
factory specified in implementationFactory to the
IServiceCollection.
public SilverbackBuilder AddSingletonSubscriber(Type subscriberType, Func<IServiceProvider, object> implementationFactory, TypeSubscriptionOptions options)
Parameters
subscriberTypeTypeThe type of the subscriber to register.
implementationFactoryFunc<IServiceProvider, object>The factory that creates the service.
optionsTypeSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
AddSingletonSubscriber(Type, Func<IServiceProvider, object>, bool)
Adds a singleton subscriber of the type specified in subscriberType with a
factory specified in implementationFactory to the
IServiceCollection.
public SilverbackBuilder AddSingletonSubscriber(Type subscriberType, Func<IServiceProvider, object> implementationFactory, bool autoSubscribeAllPublicMethods = true)
Parameters
subscriberTypeTypeThe type of the subscriber to register.
implementationFactoryFunc<IServiceProvider, object>The factory that creates the service.
autoSubscribeAllPublicMethodsboolA boolean value indicating whether all public methods of the specified type have to be automatically subscribed. When set to
falseonly the methods decorated with the SubscribeAttribute are subscribed.
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
AddSingletonSubscriber(Type, object, TypeSubscriptionOptions)
Adds a singleton subscriber of the type specified in subscriberType with an
instance specified in implementationInstance to the
IServiceCollection.
public SilverbackBuilder AddSingletonSubscriber(Type subscriberType, object implementationInstance, TypeSubscriptionOptions options)
Parameters
subscriberTypeTypeThe type of the subscriber to register.
implementationInstanceobjectThe instance of the service.
optionsTypeSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
AddSingletonSubscriber(Type, object, bool)
Adds a singleton subscriber of the type specified in subscriberType with an
instance specified in implementationInstance to the
IServiceCollection.
public SilverbackBuilder AddSingletonSubscriber(Type subscriberType, object implementationInstance, bool autoSubscribeAllPublicMethods = true)
Parameters
subscriberTypeTypeThe type of the subscriber to register.
implementationInstanceobjectThe instance of the service.
autoSubscribeAllPublicMethodsboolA boolean value indicating whether all public methods of the specified type have to be automatically subscribed. When set to
falseonly the methods decorated with the SubscribeAttribute are subscribed.
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
AddSingletonSubscriber<TSubscriber>(TypeSubscriptionOptions)
Adds a singleton subscriber of the type specified in TSubscriber to this
SilverbackBuilder.
public SilverbackBuilder AddSingletonSubscriber<TSubscriber>(TypeSubscriptionOptions options) where TSubscriber : class
Parameters
optionsTypeSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TSubscriberThe type of the subscriber to add.
AddSingletonSubscriber<TSubscriber>(bool)
Adds a singleton subscriber of the type specified in TSubscriber to this
SilverbackBuilder.
public SilverbackBuilder AddSingletonSubscriber<TSubscriber>(bool autoSubscribeAllPublicMethods = true) where TSubscriber : class
Parameters
autoSubscribeAllPublicMethodsboolA boolean value indicating whether all public methods of the specified type have to be automatically subscribed. When set to
falseonly the methods decorated with the SubscribeAttribute are subscribed.
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TSubscriberThe type of the subscriber to add.
AddSingletonSubscriber<TSubscriber>(Func<IServiceProvider, TSubscriber>, TypeSubscriptionOptions)
Adds a singleton subscriber of the type specified in TSubscriber with a
factory specified in implementationFactory to the
IServiceCollection.
public SilverbackBuilder AddSingletonSubscriber<TSubscriber>(Func<IServiceProvider, TSubscriber> implementationFactory, TypeSubscriptionOptions options) where TSubscriber : class
Parameters
implementationFactoryFunc<IServiceProvider, TSubscriber>The factory that creates the service.
optionsTypeSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TSubscriberThe type of the subscriber to add.
AddSingletonSubscriber<TSubscriber>(Func<IServiceProvider, TSubscriber>, bool)
Adds a singleton subscriber of the type specified in TSubscriber with a
factory specified in implementationFactory to the
IServiceCollection.
public SilverbackBuilder AddSingletonSubscriber<TSubscriber>(Func<IServiceProvider, TSubscriber> implementationFactory, bool autoSubscribeAllPublicMethods = true) where TSubscriber : class
Parameters
implementationFactoryFunc<IServiceProvider, TSubscriber>The factory that creates the service.
autoSubscribeAllPublicMethodsboolA boolean value indicating whether all public methods of the specified type have to be automatically subscribed. When set to
falseonly the methods decorated with the SubscribeAttribute are subscribed.
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TSubscriberThe type of the subscriber to add.
AddSingletonSubscriber<TSubscriber>(TSubscriber, TypeSubscriptionOptions)
Adds a singleton subscriber of the type specified in TSubscriber with an instance specified in
implementationInstance to the IServiceCollection.
public SilverbackBuilder AddSingletonSubscriber<TSubscriber>(TSubscriber implementationInstance, TypeSubscriptionOptions options) where TSubscriber : class
Parameters
implementationInstanceTSubscriberThe instance of the service.
optionsTypeSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TSubscriberThe type of the subscriber to register.
AddSingletonSubscriber<TSubscriber>(TSubscriber, bool)
Adds a singleton subscriber of the type specified in TSubscriber with an
instance specified in implementationInstance to the
IServiceCollection.
public SilverbackBuilder AddSingletonSubscriber<TSubscriber>(TSubscriber implementationInstance, bool autoSubscribeAllPublicMethods = true) where TSubscriber : class
Parameters
implementationInstanceTSubscriberThe instance of the service.
autoSubscribeAllPublicMethodsboolA boolean value indicating whether all public methods of the specified type have to be automatically subscribed. When set to
falseonly the methods decorated with the SubscribeAttribute are subscribed.
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TSubscriberThe type of the subscriber to register.
AddTransientBehavior(Func<IServiceProvider, IBehavior>)
Adds a scoped behavior with a factory specified in implementationFactory to the
IServiceCollection.
public SilverbackBuilder AddTransientBehavior(Func<IServiceProvider, IBehavior> implementationFactory)
Parameters
implementationFactoryFunc<IServiceProvider, IBehavior>The factory that creates the service.
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
AddTransientBehavior(Type)
Adds a scoped behavior of the type specified in behaviorType to the
IServiceCollection.
public SilverbackBuilder AddTransientBehavior(Type behaviorType)
Parameters
behaviorTypeTypeThe type of the behavior to register and the implementation to use.
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
AddTransientBehavior<TBehavior>()
Adds a scoped behavior of the type specified in TBehavior to the
IServiceCollection.
public SilverbackBuilder AddTransientBehavior<TBehavior>() where TBehavior : class, IBehavior
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TBehaviorThe type of the behavior to add.
AddTransientSubscriber(Type, TypeSubscriptionOptions)
Adds a scoped subscriber of the type specified in subscriberType to the
IServiceCollection.
public SilverbackBuilder AddTransientSubscriber(Type subscriberType, TypeSubscriptionOptions options)
Parameters
subscriberTypeTypeThe type of the subscriber to register and the implementation to use.
optionsTypeSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
AddTransientSubscriber(Type, bool)
Adds a scoped subscriber of the type specified in subscriberType to the
IServiceCollection.
public SilverbackBuilder AddTransientSubscriber(Type subscriberType, bool autoSubscribeAllPublicMethods = true)
Parameters
subscriberTypeTypeThe type of the subscriber to register and the implementation to use.
autoSubscribeAllPublicMethodsboolA boolean value indicating whether all public methods of the specified type have to be automatically subscribed. When set to
falseonly the methods decorated with the SubscribeAttribute are subscribed.
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
AddTransientSubscriber(Type, Func<IServiceProvider, object>, TypeSubscriptionOptions)
Adds a scoped subscriber of the type specified in subscriberType with a factory
specified in implementationFactory to the IServiceCollection.
public SilverbackBuilder AddTransientSubscriber(Type subscriberType, Func<IServiceProvider, object> implementationFactory, TypeSubscriptionOptions options)
Parameters
subscriberTypeTypeThe type of the subscriber to register.
implementationFactoryFunc<IServiceProvider, object>The factory that creates the service.
optionsTypeSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
AddTransientSubscriber(Type, Func<IServiceProvider, object>, bool)
Adds a scoped subscriber of the type specified in subscriberType with a factory
specified in implementationFactory to the IServiceCollection.
public SilverbackBuilder AddTransientSubscriber(Type subscriberType, Func<IServiceProvider, object> implementationFactory, bool autoSubscribeAllPublicMethods = true)
Parameters
subscriberTypeTypeThe type of the subscriber to register.
implementationFactoryFunc<IServiceProvider, object>The factory that creates the service.
autoSubscribeAllPublicMethodsboolA boolean value indicating whether all public methods of the specified type have to be automatically subscribed. When set to
falseonly the methods decorated with the SubscribeAttribute are subscribed.
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
AddTransientSubscriber<TSubscriber>(TypeSubscriptionOptions)
Adds a scoped subscriber of the type specified in TSubscriber to the
IServiceCollection.
public SilverbackBuilder AddTransientSubscriber<TSubscriber>(TypeSubscriptionOptions options) where TSubscriber : class
Parameters
optionsTypeSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TSubscriberThe type of the subscriber to add.
AddTransientSubscriber<TSubscriber>(bool)
Adds a scoped subscriber of the type specified in TSubscriber to the
IServiceCollection.
public SilverbackBuilder AddTransientSubscriber<TSubscriber>(bool autoSubscribeAllPublicMethods = true) where TSubscriber : class
Parameters
autoSubscribeAllPublicMethodsboolA boolean value indicating whether all public methods of the specified type have to be automatically subscribed. When set to
falseonly the methods decorated with the SubscribeAttribute are subscribed.
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TSubscriberThe type of the subscriber to add.
AddTransientSubscriber<TSubscriber>(Func<IServiceProvider, TSubscriber>, TypeSubscriptionOptions)
Adds a scoped subscriber of the type specified in TSubscriber with a factory
specified in implementationFactory to the IServiceCollection.
public SilverbackBuilder AddTransientSubscriber<TSubscriber>(Func<IServiceProvider, TSubscriber> implementationFactory, TypeSubscriptionOptions options) where TSubscriber : class
Parameters
implementationFactoryFunc<IServiceProvider, TSubscriber>The factory that creates the service.
optionsTypeSubscriptionOptions
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TSubscriberThe type of the subscriber to add.
AddTransientSubscriber<TSubscriber>(Func<IServiceProvider, TSubscriber>, bool)
Adds a scoped subscriber of the type specified in TSubscriber with a factory
specified in implementationFactory to the IServiceCollection.
public SilverbackBuilder AddTransientSubscriber<TSubscriber>(Func<IServiceProvider, TSubscriber> implementationFactory, bool autoSubscribeAllPublicMethods = true) where TSubscriber : class
Parameters
implementationFactoryFunc<IServiceProvider, TSubscriber>The factory that creates the service.
autoSubscribeAllPublicMethodsboolA boolean value indicating whether all public methods of the specified type have to be automatically subscribed. When set to
falseonly the methods decorated with the SubscribeAttribute are subscribed.
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TSubscriberThe type of the subscriber to add.
HandleMessagesOfType(Type)
Configures the specified type to be recognized as a message to enable features like automatic republishing.
public SilverbackBuilder HandleMessagesOfType(Type messageType)
Parameters
messageTypeTypeThe (base) message type.
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
HandleMessagesOfType<TMessage>()
Configures the type TMessage to be recognized as a message to enable features like automatic republishing.
public SilverbackBuilder HandleMessagesOfType<TMessage>()
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.
Type Parameters
TMessageThe (base) message type.
WithLogLevels(Action<LogLevelConfigurator>)
Configures the log levels that should be used to log the standard Silverback events.
public SilverbackBuilder WithLogLevels(Action<LogLevelConfigurator> logLevelsConfigurationAction)
Parameters
logLevelsConfigurationActionAction<LogLevelConfigurator>The log levels configuration action.
Returns
- SilverbackBuilder
The SilverbackBuilder so that additional calls can be chained.