Class SilverbackBuilderAddSubscriberExtensions
Adds the AddTransientSubscriber
, AddScopedSubscriber
and AddSingletonSubscriber
methods to the ISilverbackBuilder.
Inheritance
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
Microsoft.Extensions.DependencyInjection.IServiceCollection.
Declaration
public static ISilverbackBuilder AddScopedSubscriber(this ISilverbackBuilder silverbackBuilder, Type subscriberType, TypeSubscriptionOptions options)
Parameters
Type | Name | Description |
---|---|---|
ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the Microsoft.Extensions.DependencyInjection.IServiceCollection to add the subscriber to. |
System.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, Boolean)
Adds a scoped subscriber of the type specified in subscriberType
to the
Microsoft.Extensions.DependencyInjection.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 Microsoft.Extensions.DependencyInjection.IServiceCollection to add the subscriber to. |
System.Type | subscriberType | The type of the subscriber to register and the implementation to use. |
System.Boolean | 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 Microsoft.Extensions.DependencyInjection.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 Microsoft.Extensions.DependencyInjection.IServiceCollection to add the subscriber to. |
System.Type | subscriberType | The type of the subscriber to register. |
System.Func<System.IServiceProvider, System.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>, Boolean)
Adds a scoped subscriber of the type specified in subscriberType
with a factory
specified in implementationFactory
to the Microsoft.Extensions.DependencyInjection.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 Microsoft.Extensions.DependencyInjection.IServiceCollection to add the subscriber to. |
System.Type | subscriberType | The type of the subscriber to register. |
System.Func<System.IServiceProvider, System.Object> | implementationFactory | The factory that creates the service. |
System.Boolean | 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
Microsoft.Extensions.DependencyInjection.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 Microsoft.Extensions.DependencyInjection.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, Boolean)
Adds a scoped subscriber of the type specified in TSubscriber
to the
Microsoft.Extensions.DependencyInjection.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 Microsoft.Extensions.DependencyInjection.IServiceCollection to add the subscriber to. |
System.Boolean | 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 Microsoft.Extensions.DependencyInjection.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 Microsoft.Extensions.DependencyInjection.IServiceCollection to add the subscriber to. |
System.Func<System.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>, Boolean)
Adds a scoped subscriber of the type specified in TSubscriber
with a factory
specified in implementationFactory
to the Microsoft.Extensions.DependencyInjection.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 Microsoft.Extensions.DependencyInjection.IServiceCollection to add the subscriber to. |
System.Func<System.IServiceProvider, TSubscriber> | implementationFactory | The factory that creates the service. |
System.Boolean | 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
Microsoft.Extensions.DependencyInjection.IServiceCollection.
Declaration
public static ISilverbackBuilder AddSingletonSubscriber(this ISilverbackBuilder silverbackBuilder, Type subscriberType, TypeSubscriptionOptions options)
Parameters
Type | Name | Description |
---|---|---|
ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the Microsoft.Extensions.DependencyInjection.IServiceCollection to add the subscriber to. |
System.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, Boolean)
Adds a singleton subscriber of the type specified in subscriberType
to the
Microsoft.Extensions.DependencyInjection.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 Microsoft.Extensions.DependencyInjection.IServiceCollection to add the subscriber to. |
System.Type | subscriberType | The type of the subscriber to register and the implementation to use. |
System.Boolean | 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
Microsoft.Extensions.DependencyInjection.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 Microsoft.Extensions.DependencyInjection.IServiceCollection to add the subscriber to. |
System.Type | subscriberType | The type of the subscriber to register. |
System.Func<System.IServiceProvider, System.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>, Boolean)
Adds a singleton subscriber of the type specified in subscriberType
with a
factory specified in implementationFactory
to the
Microsoft.Extensions.DependencyInjection.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 Microsoft.Extensions.DependencyInjection.IServiceCollection to add the subscriber to. |
System.Type | subscriberType | The type of the subscriber to register. |
System.Func<System.IServiceProvider, System.Object> | implementationFactory | The factory that creates the service. |
System.Boolean | 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
Microsoft.Extensions.DependencyInjection.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 Microsoft.Extensions.DependencyInjection.IServiceCollection to add the subscriber to. |
System.Type | subscriberType | The type of the subscriber to register. |
System.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, Boolean)
Adds a singleton subscriber of the type specified in subscriberType
with an
instance specified in implementationInstance
to the
Microsoft.Extensions.DependencyInjection.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 Microsoft.Extensions.DependencyInjection.IServiceCollection to add the subscriber to. |
System.Type | subscriberType | The type of the subscriber to register. |
System.Object | implementationInstance | The instance of the service. |
System.Boolean | 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, TSubscriber, TypeSubscriptionOptions)
Adds a singleton subscriber of the type specified in TSubscriber
with an
instance specified in implementationInstance
to the
Microsoft.Extensions.DependencyInjection.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 Microsoft.Extensions.DependencyInjection.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, Boolean)
Adds a singleton subscriber of the type specified in TSubscriber
with an
instance specified in implementationInstance
to the
Microsoft.Extensions.DependencyInjection.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 Microsoft.Extensions.DependencyInjection.IServiceCollection to add the subscriber to. |
TSubscriber | implementationInstance | The instance of the service. |
System.Boolean | 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. |
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 Microsoft.Extensions.DependencyInjection.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, Boolean)
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 Microsoft.Extensions.DependencyInjection.IServiceCollection to add the subscriber to. |
System.Boolean | 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
Microsoft.Extensions.DependencyInjection.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 Microsoft.Extensions.DependencyInjection.IServiceCollection to add the subscriber to. |
System.Func<System.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>, Boolean)
Adds a singleton subscriber of the type specified in TSubscriber
with a
factory specified in implementationFactory
to the
Microsoft.Extensions.DependencyInjection.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 Microsoft.Extensions.DependencyInjection.IServiceCollection to add the subscriber to. |
System.Func<System.IServiceProvider, TSubscriber> | implementationFactory | The factory that creates the service. |
System.Boolean | 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. |
AddSubscribers<TSubscriber>(ISilverbackBuilder, TypeSubscriptionOptions)
Registers the base type to be resolved as subscriber. The actual types have to be added to the Microsoft.Extensions.DependencyInjection.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 Microsoft.Extensions.DependencyInjection.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, Boolean)
Registers the base type to be resolved as subscriber. The actual types have to be added to the Microsoft.Extensions.DependencyInjection.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 Microsoft.Extensions.DependencyInjection.IServiceCollection to add the subscriber to. |
System.Boolean | 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
Microsoft.Extensions.DependencyInjection.IServiceCollection.
Declaration
public static ISilverbackBuilder AddTransientSubscriber(this ISilverbackBuilder silverbackBuilder, Type subscriberType, TypeSubscriptionOptions options)
Parameters
Type | Name | Description |
---|---|---|
ISilverbackBuilder | silverbackBuilder | The ISilverbackBuilder that references the Microsoft.Extensions.DependencyInjection.IServiceCollection to add the subscriber to. |
System.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, Boolean)
Adds a scoped subscriber of the type specified in subscriberType
to the
Microsoft.Extensions.DependencyInjection.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 Microsoft.Extensions.DependencyInjection.IServiceCollection to add the subscriber to. |
System.Type | subscriberType | The type of the subscriber to register and the implementation to use. |
System.Boolean | 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 Microsoft.Extensions.DependencyInjection.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 Microsoft.Extensions.DependencyInjection.IServiceCollection to add the subscriber to. |
System.Type | subscriberType | The type of the subscriber to register. |
System.Func<System.IServiceProvider, System.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>, Boolean)
Adds a scoped subscriber of the type specified in subscriberType
with a factory
specified in implementationFactory
to the Microsoft.Extensions.DependencyInjection.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 Microsoft.Extensions.DependencyInjection.IServiceCollection to add the subscriber to. |
System.Type | subscriberType | The type of the subscriber to register. |
System.Func<System.IServiceProvider, System.Object> | implementationFactory | The factory that creates the service. |
System.Boolean | 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
Microsoft.Extensions.DependencyInjection.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 Microsoft.Extensions.DependencyInjection.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, Boolean)
Adds a scoped subscriber of the type specified in TSubscriber
to the
Microsoft.Extensions.DependencyInjection.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 Microsoft.Extensions.DependencyInjection.IServiceCollection to add the subscriber to. |
System.Boolean | 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 Microsoft.Extensions.DependencyInjection.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 Microsoft.Extensions.DependencyInjection.IServiceCollection to add the subscriber to. |
System.Func<System.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>, Boolean)
Adds a scoped subscriber of the type specified in TSubscriber
with a factory
specified in implementationFactory
to the Microsoft.Extensions.DependencyInjection.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 Microsoft.Extensions.DependencyInjection.IServiceCollection to add the subscriber to. |
System.Func<System.IServiceProvider, TSubscriber> | implementationFactory | The factory that creates the service. |
System.Boolean | 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. |