Class SilverbackBuilderAddSubscriberExtensions
Adds the AddTransientSubscriber, AddScopedSubscriber and AddSingletonSubscriber
methods to the ISilverbackBuilder.
Inherited Members
Namespace: Microsoft.Extensions.DependencyInjection
Assembly: Silverback.Core.dll
Syntax
public static class SilverbackBuilderAddSubscriberExtensions
Methods
| Improve this doc View sourceAddScopedSubscriber(ISilverbackBuilder, Type, TypeSubscriptionOptions)
Adds a scoped subscriber of the type specified in subscriberType to the
IServiceCollection.
Declaration
public static ISilverbackBuilder AddScopedSubscriber(this ISilverbackBuilder silverbackBuilder, Type subscriberType, TypeSubscriptionOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| Type | subscriberType | The type of the subscriber to register and the implementation to use. |
| TypeSubscriptionOptions | options |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
AddScopedSubscriber(ISilverbackBuilder, Type, bool)
Adds a scoped subscriber of the type specified in subscriberType to the
IServiceCollection.
Declaration
public static ISilverbackBuilder AddScopedSubscriber(this ISilverbackBuilder silverbackBuilder, Type subscriberType, bool autoSubscribeAllPublicMethods = true)
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| Type | subscriberType | The type of the subscriber to register and the implementation to use. |
| bool | autoSubscribeAllPublicMethods | A boolean value indicating whether all public methods of the specified type have to be automatically
subscribed. When set to |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
AddScopedSubscriber(ISilverbackBuilder, Type, Func<IServiceProvider, object>, TypeSubscriptionOptions)
Adds a scoped subscriber of the type specified in subscriberType with a factory
specified in implementationFactory to the IServiceCollection.
Declaration
public static ISilverbackBuilder AddScopedSubscriber(this ISilverbackBuilder silverbackBuilder, Type subscriberType, Func<IServiceProvider, object> implementationFactory, TypeSubscriptionOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| Type | subscriberType | The type of the subscriber to register. |
| Func<IServiceProvider, object> | implementationFactory | The factory that creates the service. |
| TypeSubscriptionOptions | options |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
AddScopedSubscriber(ISilverbackBuilder, Type, Func<IServiceProvider, object>, bool)
Adds a scoped subscriber of the type specified in subscriberType with a factory
specified in implementationFactory to the IServiceCollection.
Declaration
public static ISilverbackBuilder AddScopedSubscriber(this ISilverbackBuilder silverbackBuilder, Type subscriberType, Func<IServiceProvider, object> implementationFactory, bool autoSubscribeAllPublicMethods = true)
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| Type | subscriberType | The type of the subscriber to register. |
| Func<IServiceProvider, object> | implementationFactory | The factory that creates the service. |
| bool | autoSubscribeAllPublicMethods | A boolean value indicating whether all public methods of the specified type have to be automatically
subscribed. When set to |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
AddScopedSubscriber<TSubscriber>(ISilverbackBuilder, TypeSubscriptionOptions)
Adds a scoped subscriber of the type specified in TSubscriber to the
IServiceCollection.
Declaration
public static ISilverbackBuilder AddScopedSubscriber<TSubscriber>(this ISilverbackBuilder silverbackBuilder, TypeSubscriptionOptions options) where TSubscriber : class
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| TypeSubscriptionOptions | options |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
Type Parameters
| Name | Description |
|---|---|
| TSubscriber | The type of the subscriber to add. |
AddScopedSubscriber<TSubscriber>(ISilverbackBuilder, bool)
Adds a scoped subscriber of the type specified in TSubscriber to the
IServiceCollection.
Declaration
public static ISilverbackBuilder AddScopedSubscriber<TSubscriber>(this ISilverbackBuilder silverbackBuilder, bool autoSubscribeAllPublicMethods = true) where TSubscriber : class
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| bool | autoSubscribeAllPublicMethods | A boolean value indicating whether all public methods of the specified type have to be automatically
subscribed. When set to |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
Type Parameters
| Name | Description |
|---|---|
| TSubscriber | The type of the subscriber to add. |
AddScopedSubscriber<TSubscriber>(ISilverbackBuilder, Func<IServiceProvider, TSubscriber>, TypeSubscriptionOptions)
Adds a scoped subscriber of the type specified in TSubscriber with a factory
specified in implementationFactory to the IServiceCollection.
Declaration
public static ISilverbackBuilder AddScopedSubscriber<TSubscriber>(this ISilverbackBuilder silverbackBuilder, Func<IServiceProvider, TSubscriber> implementationFactory, TypeSubscriptionOptions options) where TSubscriber : class
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| Func<IServiceProvider, TSubscriber> | implementationFactory | The factory that creates the service. |
| TypeSubscriptionOptions | options |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
Type Parameters
| Name | Description |
|---|---|
| TSubscriber | The type of the subscriber to add. |
AddScopedSubscriber<TSubscriber>(ISilverbackBuilder, Func<IServiceProvider, TSubscriber>, bool)
Adds a scoped subscriber of the type specified in TSubscriber with a factory
specified in implementationFactory to the IServiceCollection.
Declaration
public static ISilverbackBuilder AddScopedSubscriber<TSubscriber>(this ISilverbackBuilder silverbackBuilder, Func<IServiceProvider, TSubscriber> implementationFactory, bool autoSubscribeAllPublicMethods = true) where TSubscriber : class
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| Func<IServiceProvider, TSubscriber> | implementationFactory | The factory that creates the service. |
| bool | autoSubscribeAllPublicMethods | A boolean value indicating whether all public methods of the specified type have to be automatically
subscribed. When set to |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
Type Parameters
| Name | Description |
|---|---|
| TSubscriber | The type of the subscriber to add. |
AddSingletonSubscriber(ISilverbackBuilder, Type, TypeSubscriptionOptions)
Adds a singleton subscriber of the type specified in subscriberType to the
IServiceCollection.
Declaration
public static ISilverbackBuilder AddSingletonSubscriber(this ISilverbackBuilder silverbackBuilder, Type subscriberType, TypeSubscriptionOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| Type | subscriberType | The type of the subscriber to register and the implementation to use. |
| TypeSubscriptionOptions | options |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
AddSingletonSubscriber(ISilverbackBuilder, Type, bool)
Adds a singleton subscriber of the type specified in subscriberType to the
IServiceCollection.
Declaration
public static ISilverbackBuilder AddSingletonSubscriber(this ISilverbackBuilder silverbackBuilder, Type subscriberType, bool autoSubscribeAllPublicMethods = true)
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| Type | subscriberType | The type of the subscriber to register and the implementation to use. |
| bool | autoSubscribeAllPublicMethods | A boolean value indicating whether all public methods of the specified type have to be automatically
subscribed. When set to |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
AddSingletonSubscriber(ISilverbackBuilder, Type, Func<IServiceProvider, object>, TypeSubscriptionOptions)
Adds a singleton subscriber of the type specified in subscriberType with a
factory specified in implementationFactory to the
IServiceCollection.
Declaration
public static ISilverbackBuilder AddSingletonSubscriber(this ISilverbackBuilder silverbackBuilder, Type subscriberType, Func<IServiceProvider, object> implementationFactory, TypeSubscriptionOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| Type | subscriberType | The type of the subscriber to register. |
| Func<IServiceProvider, object> | implementationFactory | The factory that creates the service. |
| TypeSubscriptionOptions | options |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
AddSingletonSubscriber(ISilverbackBuilder, Type, Func<IServiceProvider, object>, bool)
Adds a singleton subscriber of the type specified in subscriberType with a
factory specified in implementationFactory to the
IServiceCollection.
Declaration
public static ISilverbackBuilder AddSingletonSubscriber(this ISilverbackBuilder silverbackBuilder, Type subscriberType, Func<IServiceProvider, object> implementationFactory, bool autoSubscribeAllPublicMethods = true)
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| Type | subscriberType | The type of the subscriber to register. |
| Func<IServiceProvider, object> | implementationFactory | The factory that creates the service. |
| bool | autoSubscribeAllPublicMethods | A boolean value indicating whether all public methods of the specified type have to be automatically
subscribed. When set to |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
AddSingletonSubscriber(ISilverbackBuilder, Type, object, TypeSubscriptionOptions)
Adds a singleton subscriber of the type specified in subscriberType with an
instance specified in implementationInstance to the
IServiceCollection.
Declaration
public static ISilverbackBuilder AddSingletonSubscriber(this ISilverbackBuilder silverbackBuilder, Type subscriberType, object implementationInstance, TypeSubscriptionOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| Type | subscriberType | The type of the subscriber to register. |
| object | implementationInstance | The instance of the service. |
| TypeSubscriptionOptions | options |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
AddSingletonSubscriber(ISilverbackBuilder, Type, object, bool)
Adds a singleton subscriber of the type specified in subscriberType with an
instance specified in implementationInstance to the
IServiceCollection.
Declaration
public static ISilverbackBuilder AddSingletonSubscriber(this ISilverbackBuilder silverbackBuilder, Type subscriberType, object implementationInstance, bool autoSubscribeAllPublicMethods = true)
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| Type | subscriberType | The type of the subscriber to register. |
| object | implementationInstance | The instance of the service. |
| bool | autoSubscribeAllPublicMethods | A boolean value indicating whether all public methods of the specified type have to be automatically
subscribed. When set to |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
AddSingletonSubscriber<TSubscriber>(ISilverbackBuilder, TypeSubscriptionOptions)
Adds a singleton subscriber of the type specified in TSubscriber to this
ISilverbackBuilder.
Declaration
public static ISilverbackBuilder AddSingletonSubscriber<TSubscriber>(this ISilverbackBuilder silverbackBuilder, TypeSubscriptionOptions options) where TSubscriber : class
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| TypeSubscriptionOptions | options |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
Type Parameters
| Name | Description |
|---|---|
| TSubscriber | The type of the subscriber to add. |
AddSingletonSubscriber<TSubscriber>(ISilverbackBuilder, bool)
Adds a singleton subscriber of the type specified in TSubscriber to this
ISilverbackBuilder.
Declaration
public static ISilverbackBuilder AddSingletonSubscriber<TSubscriber>(this ISilverbackBuilder silverbackBuilder, bool autoSubscribeAllPublicMethods = true) where TSubscriber : class
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| bool | autoSubscribeAllPublicMethods | A boolean value indicating whether all public methods of the specified type have to be automatically
subscribed. When set to |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
Type Parameters
| Name | Description |
|---|---|
| TSubscriber | The type of the subscriber to add. |
AddSingletonSubscriber<TSubscriber>(ISilverbackBuilder, Func<IServiceProvider, TSubscriber>, TypeSubscriptionOptions)
Adds a singleton subscriber of the type specified in TSubscriber with a
factory specified in implementationFactory to the
IServiceCollection.
Declaration
public static ISilverbackBuilder AddSingletonSubscriber<TSubscriber>(this ISilverbackBuilder silverbackBuilder, Func<IServiceProvider, TSubscriber> implementationFactory, TypeSubscriptionOptions options) where TSubscriber : class
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| Func<IServiceProvider, TSubscriber> | implementationFactory | The factory that creates the service. |
| TypeSubscriptionOptions | options |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
Type Parameters
| Name | Description |
|---|---|
| TSubscriber | The type of the subscriber to add. |
AddSingletonSubscriber<TSubscriber>(ISilverbackBuilder, Func<IServiceProvider, TSubscriber>, bool)
Adds a singleton subscriber of the type specified in TSubscriber with a
factory specified in implementationFactory to the
IServiceCollection.
Declaration
public static ISilverbackBuilder AddSingletonSubscriber<TSubscriber>(this ISilverbackBuilder silverbackBuilder, Func<IServiceProvider, TSubscriber> implementationFactory, bool autoSubscribeAllPublicMethods = true) where TSubscriber : class
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| Func<IServiceProvider, TSubscriber> | implementationFactory | The factory that creates the service. |
| bool | autoSubscribeAllPublicMethods | A boolean value indicating whether all public methods of the specified type have to be automatically
subscribed. When set to |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
Type Parameters
| Name | Description |
|---|---|
| TSubscriber | The type of the subscriber to add. |
AddSingletonSubscriber<TSubscriber>(ISilverbackBuilder, TSubscriber, TypeSubscriptionOptions)
Adds a singleton subscriber of the type specified in TSubscriber with an
instance specified in implementationInstance to the
IServiceCollection.
Declaration
public static ISilverbackBuilder AddSingletonSubscriber<TSubscriber>(this ISilverbackBuilder silverbackBuilder, TSubscriber implementationInstance, TypeSubscriptionOptions options) where TSubscriber : class
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| TSubscriber | implementationInstance | The instance of the service. |
| TypeSubscriptionOptions | options |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
Type Parameters
| Name | Description |
|---|---|
| TSubscriber | The type of the subscriber to register. |
AddSingletonSubscriber<TSubscriber>(ISilverbackBuilder, TSubscriber, bool)
Adds a singleton subscriber of the type specified in TSubscriber with an
instance specified in implementationInstance to the
IServiceCollection.
Declaration
public static ISilverbackBuilder AddSingletonSubscriber<TSubscriber>(this ISilverbackBuilder silverbackBuilder, TSubscriber implementationInstance, bool autoSubscribeAllPublicMethods = true) where TSubscriber : class
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| TSubscriber | implementationInstance | The instance of the service. |
| bool | autoSubscribeAllPublicMethods | A boolean value indicating whether all public methods of the specified type have to be automatically
subscribed. When set to |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
Type Parameters
| Name | Description |
|---|---|
| TSubscriber | The type of the subscriber to register. |
AddSubscribers<TSubscriber>(ISilverbackBuilder, TypeSubscriptionOptions)
Registers the base type to be resolved as subscriber. The actual types have to be added to the IServiceCollection separately.
Declaration
public static ISilverbackBuilder AddSubscribers<TSubscriber>(this ISilverbackBuilder silverbackBuilder, TypeSubscriptionOptions options) where TSubscriber : class
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| TypeSubscriptionOptions | options |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
Type Parameters
| Name | Description |
|---|---|
| TSubscriber | The base type of the subscribers (class or interface). |
Remarks
The subscribers will have to be registered twice (with the base type and the type itself:
.AddScoped<BaseType, Subscriber>.AddScoped<Subscriber>).
AddSubscribers<TSubscriber>(ISilverbackBuilder, bool)
Registers the base type to be resolved as subscriber. The actual types have to be added to the IServiceCollection separately.
Declaration
public static ISilverbackBuilder AddSubscribers<TSubscriber>(this ISilverbackBuilder silverbackBuilder, bool autoSubscribeAllPublicMethods = true) where TSubscriber : class
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| bool | autoSubscribeAllPublicMethods | A boolean value indicating whether all public methods of the specified type have to be automatically
subscribed. When set to |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
Type Parameters
| Name | Description |
|---|---|
| TSubscriber | The base type of the subscribers (class or interface). |
Remarks
The subscribers will have to be registered twice (with the base type and the type itself:
.AddScoped<BaseType, Subscriber>.AddScoped<Subscriber>).
AddTransientSubscriber(ISilverbackBuilder, Type, TypeSubscriptionOptions)
Adds a scoped subscriber of the type specified in subscriberType to the
IServiceCollection.
Declaration
public static ISilverbackBuilder AddTransientSubscriber(this ISilverbackBuilder silverbackBuilder, Type subscriberType, TypeSubscriptionOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| Type | subscriberType | The type of the subscriber to register and the implementation to use. |
| TypeSubscriptionOptions | options |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
AddTransientSubscriber(ISilverbackBuilder, Type, bool)
Adds a scoped subscriber of the type specified in subscriberType to the
IServiceCollection.
Declaration
public static ISilverbackBuilder AddTransientSubscriber(this ISilverbackBuilder silverbackBuilder, Type subscriberType, bool autoSubscribeAllPublicMethods = true)
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| Type | subscriberType | The type of the subscriber to register and the implementation to use. |
| bool | autoSubscribeAllPublicMethods | A boolean value indicating whether all public methods of the specified type have to be automatically
subscribed. When set to |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
AddTransientSubscriber(ISilverbackBuilder, Type, Func<IServiceProvider, object>, TypeSubscriptionOptions)
Adds a scoped subscriber of the type specified in subscriberType with a factory
specified in implementationFactory to the IServiceCollection.
Declaration
public static ISilverbackBuilder AddTransientSubscriber(this ISilverbackBuilder silverbackBuilder, Type subscriberType, Func<IServiceProvider, object> implementationFactory, TypeSubscriptionOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| Type | subscriberType | The type of the subscriber to register. |
| Func<IServiceProvider, object> | implementationFactory | The factory that creates the service. |
| TypeSubscriptionOptions | options |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
AddTransientSubscriber(ISilverbackBuilder, Type, Func<IServiceProvider, object>, bool)
Adds a scoped subscriber of the type specified in subscriberType with a factory
specified in implementationFactory to the IServiceCollection.
Declaration
public static ISilverbackBuilder AddTransientSubscriber(this ISilverbackBuilder silverbackBuilder, Type subscriberType, Func<IServiceProvider, object> implementationFactory, bool autoSubscribeAllPublicMethods = true)
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| Type | subscriberType | The type of the subscriber to register. |
| Func<IServiceProvider, object> | implementationFactory | The factory that creates the service. |
| bool | autoSubscribeAllPublicMethods | A boolean value indicating whether all public methods of the specified type have to be automatically
subscribed. When set to |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
AddTransientSubscriber<TSubscriber>(ISilverbackBuilder, TypeSubscriptionOptions)
Adds a scoped subscriber of the type specified in TSubscriber to the
IServiceCollection.
Declaration
public static ISilverbackBuilder AddTransientSubscriber<TSubscriber>(this ISilverbackBuilder silverbackBuilder, TypeSubscriptionOptions options) where TSubscriber : class
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| TypeSubscriptionOptions | options |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
Type Parameters
| Name | Description |
|---|---|
| TSubscriber | The type of the subscriber to add. |
AddTransientSubscriber<TSubscriber>(ISilverbackBuilder, bool)
Adds a scoped subscriber of the type specified in TSubscriber to the
IServiceCollection.
Declaration
public static ISilverbackBuilder AddTransientSubscriber<TSubscriber>(this ISilverbackBuilder silverbackBuilder, bool autoSubscribeAllPublicMethods = true) where TSubscriber : class
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| bool | autoSubscribeAllPublicMethods | A boolean value indicating whether all public methods of the specified type have to be automatically
subscribed. When set to |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
Type Parameters
| Name | Description |
|---|---|
| TSubscriber | The type of the subscriber to add. |
AddTransientSubscriber<TSubscriber>(ISilverbackBuilder, Func<IServiceProvider, TSubscriber>, TypeSubscriptionOptions)
Adds a scoped subscriber of the type specified in TSubscriber with a factory
specified in implementationFactory to the IServiceCollection.
Declaration
public static ISilverbackBuilder AddTransientSubscriber<TSubscriber>(this ISilverbackBuilder silverbackBuilder, Func<IServiceProvider, TSubscriber> implementationFactory, TypeSubscriptionOptions options) where TSubscriber : class
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| Func<IServiceProvider, TSubscriber> | implementationFactory | The factory that creates the service. |
| TypeSubscriptionOptions | options |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
Type Parameters
| Name | Description |
|---|---|
| TSubscriber | The type of the subscriber to add. |
AddTransientSubscriber<TSubscriber>(ISilverbackBuilder, Func<IServiceProvider, TSubscriber>, bool)
Adds a scoped subscriber of the type specified in TSubscriber with a factory
specified in implementationFactory to the IServiceCollection.
Declaration
public static ISilverbackBuilder AddTransientSubscriber<TSubscriber>(this ISilverbackBuilder silverbackBuilder, Func<IServiceProvider, TSubscriber> implementationFactory, bool autoSubscribeAllPublicMethods = true) where TSubscriber : class
Parameters
| Type | Name | Description |
|---|---|---|
| ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the IServiceCollection to add the subscriber to. |
| Func<IServiceProvider, TSubscriber> | implementationFactory | The factory that creates the service. |
| bool | autoSubscribeAllPublicMethods | A boolean value indicating whether all public methods of the specified type have to be automatically
subscribed. When set to |
Returns
| Type | Description |
|---|---|
| ISilverbackBuilder | The ISilverbackBuilder so that additional calls can be chained. |
Type Parameters
| Name | Description |
|---|---|
| TSubscriber | The type of the subscriber to add. |