Show / Hide Table of Contents

    Class SilverbackBuilderAddSubscriberExtensions

    Adds the AddTransientSubscriber, AddScopedSubscriber and AddSingletonSubscriber methods to the ISilverbackBuilder.

    Inheritance
    object
    SilverbackBuilderAddSubscriberExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Microsoft.Extensions.DependencyInjection
    Assembly: Silverback.Core.dll
    Syntax
    public static class SilverbackBuilderAddSubscriberExtensions

    Methods

    | Improve this doc View source

    AddScopedSubscriber(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

    The TypeSubscriptionOptions.

    Returns
    Type Description
    ISilverbackBuilder

    The ISilverbackBuilder so that additional calls can be chained.

    | Improve this doc View source

    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 false only the methods decorated with the SubscribeAttribute are subscribed.

    Returns
    Type Description
    ISilverbackBuilder

    The ISilverbackBuilder so that additional calls can be chained.

    | Improve this doc View source

    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

    The TypeSubscriptionOptions.

    Returns
    Type Description
    ISilverbackBuilder

    The ISilverbackBuilder so that additional calls can be chained.

    | Improve this doc View source

    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 false only the methods decorated with the SubscribeAttribute are subscribed.

    Returns
    Type Description
    ISilverbackBuilder

    The ISilverbackBuilder so that additional calls can be chained.

    | Improve this doc View source

    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

    The TypeSubscriptionOptions.

    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.

    | Improve this doc View source

    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 false only the methods decorated with the SubscribeAttribute are subscribed.

    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.

    | Improve this doc View source

    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

    The TypeSubscriptionOptions.

    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.

    | Improve this doc View source

    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 false only the methods decorated with the SubscribeAttribute are subscribed.

    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.

    | Improve this doc View source

    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

    The TypeSubscriptionOptions.

    Returns
    Type Description
    ISilverbackBuilder

    The ISilverbackBuilder so that additional calls can be chained.

    | Improve this doc View source

    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 false only the methods decorated with the SubscribeAttribute are subscribed.

    Returns
    Type Description
    ISilverbackBuilder

    The ISilverbackBuilder so that additional calls can be chained.

    | Improve this doc View source

    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

    The TypeSubscriptionOptions.

    Returns
    Type Description
    ISilverbackBuilder

    The ISilverbackBuilder so that additional calls can be chained.

    | Improve this doc View source

    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 false only the methods decorated with the SubscribeAttribute are subscribed.

    Returns
    Type Description
    ISilverbackBuilder

    The ISilverbackBuilder so that additional calls can be chained.

    | Improve this doc View source

    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

    The TypeSubscriptionOptions.

    Returns
    Type Description
    ISilverbackBuilder

    The ISilverbackBuilder so that additional calls can be chained.

    | Improve this doc View source

    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 false only the methods decorated with the SubscribeAttribute are subscribed.

    Returns
    Type Description
    ISilverbackBuilder

    The ISilverbackBuilder so that additional calls can be chained.

    | Improve this doc View source

    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

    The TypeSubscriptionOptions.

    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.

    | Improve this doc View source

    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 false only the methods decorated with the SubscribeAttribute are subscribed.

    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.

    | Improve this doc View source

    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

    The TypeSubscriptionOptions.

    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.

    | Improve this doc View source

    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 false only the methods decorated with the SubscribeAttribute are subscribed.

    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.

    | Improve this doc View source

    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

    The TypeSubscriptionOptions.

    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.

    | Improve this doc View source

    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 false only the methods decorated with the SubscribeAttribute are subscribed.

    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.

    | Improve this doc View source

    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

    The TypeSubscriptionOptions.

    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>).

    | Improve this doc View source

    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 false only the methods decorated with the SubscribeAttribute are subscribed.

    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>).

    | Improve this doc View source

    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

    The TypeSubscriptionOptions.

    Returns
    Type Description
    ISilverbackBuilder

    The ISilverbackBuilder so that additional calls can be chained.

    | Improve this doc View source

    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 false only the methods decorated with the SubscribeAttribute are subscribed.

    Returns
    Type Description
    ISilverbackBuilder

    The ISilverbackBuilder so that additional calls can be chained.

    | Improve this doc View source

    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

    The TypeSubscriptionOptions.

    Returns
    Type Description
    ISilverbackBuilder

    The ISilverbackBuilder so that additional calls can be chained.

    | Improve this doc View source

    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 false only the methods decorated with the SubscribeAttribute are subscribed.

    Returns
    Type Description
    ISilverbackBuilder

    The ISilverbackBuilder so that additional calls can be chained.

    | Improve this doc View source

    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

    The TypeSubscriptionOptions.

    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.

    | Improve this doc View source

    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 false only the methods decorated with the SubscribeAttribute are subscribed.

    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.

    | Improve this doc View source

    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

    The TypeSubscriptionOptions.

    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.

    | Improve this doc View source

    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 false only the methods decorated with the SubscribeAttribute are subscribed.

    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.

    • Improve this doc
    • View source
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini