Show / Hide Table of Contents

    Class SilverbackBuilderAddBehaviorExtensions

    Adds the AddTransientBehavior, AddScopedBehavior and AddSingletonBehavior methods to the ISilverbackBuilder.

    Inheritance
    object
    SilverbackBuilderAddBehaviorExtensions
    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 SilverbackBuilderAddBehaviorExtensions

    Methods

    | Improve this doc View source

    AddScopedBehavior(ISilverbackBuilder, Func<IServiceProvider, IBehavior>)

    Adds a scoped behavior with a factory specified in implementationFactory to the IServiceCollection.

    Declaration
    public static ISilverbackBuilder AddScopedBehavior(this ISilverbackBuilder silverbackBuilder, Func<IServiceProvider, IBehavior> implementationFactory)
    Parameters
    Type Name Description
    ISilverbackBuilder silverbackBuilder

    The ISilverbackBuilder that references the IServiceCollection to add the behavior to.

    Func<IServiceProvider, IBehavior> implementationFactory

    The factory that creates the service.

    Returns
    Type Description
    ISilverbackBuilder

    The ISilverbackBuilder so that additional calls can be chained.

    | Improve this doc View source

    AddScopedBehavior(ISilverbackBuilder, Type)

    Adds a scoped behavior of the type specified in behaviorType to the IServiceCollection.

    Declaration
    public static ISilverbackBuilder AddScopedBehavior(this ISilverbackBuilder silverbackBuilder, Type behaviorType)
    Parameters
    Type Name Description
    ISilverbackBuilder silverbackBuilder

    The ISilverbackBuilder that references the IServiceCollection to add the behavior to.

    Type behaviorType

    The type of the behavior to register and the implementation to use.

    Returns
    Type Description
    ISilverbackBuilder

    The ISilverbackBuilder so that additional calls can be chained.

    | Improve this doc View source

    AddScopedBehavior<TBehavior>(ISilverbackBuilder)

    Adds a scoped behavior of the type specified in TBehavior to the IServiceCollection.

    Declaration
    public static ISilverbackBuilder AddScopedBehavior<TBehavior>(this ISilverbackBuilder silverbackBuilder) where TBehavior : class, IBehavior
    Parameters
    Type Name Description
    ISilverbackBuilder silverbackBuilder

    The ISilverbackBuilder that references the IServiceCollection to add the behavior to.

    Returns
    Type Description
    ISilverbackBuilder

    The ISilverbackBuilder so that additional calls can be chained.

    Type Parameters
    Name Description
    TBehavior

    The type of the behavior to add.

    | Improve this doc View source

    AddSingletonBehavior(ISilverbackBuilder, IBehavior)

    Adds a singleton behavior with an instance specified in implementationInstance to the IServiceCollection.

    Declaration
    public static ISilverbackBuilder AddSingletonBehavior(this ISilverbackBuilder silverbackBuilder, IBehavior implementationInstance)
    Parameters
    Type Name Description
    ISilverbackBuilder silverbackBuilder

    The ISilverbackBuilder that references the IServiceCollection to add the behavior to.

    IBehavior implementationInstance

    The instance of the service.

    Returns
    Type Description
    ISilverbackBuilder

    The ISilverbackBuilder so that additional calls can be chained.

    | Improve this doc View source

    AddSingletonBehavior(ISilverbackBuilder, Func<IServiceProvider, IBehavior>)

    Adds a singleton behavior with a factory specified in implementationFactory to the IServiceCollection.

    Declaration
    public static ISilverbackBuilder AddSingletonBehavior(this ISilverbackBuilder silverbackBuilder, Func<IServiceProvider, IBehavior> implementationFactory)
    Parameters
    Type Name Description
    ISilverbackBuilder silverbackBuilder

    The ISilverbackBuilder that references the IServiceCollection to add the behavior to.

    Func<IServiceProvider, IBehavior> implementationFactory

    The factory that creates the service.

    Returns
    Type Description
    ISilverbackBuilder

    The ISilverbackBuilder so that additional calls can be chained.

    | Improve this doc View source

    AddSingletonBehavior(ISilverbackBuilder, Type)

    Adds a singleton behavior of the type specified in behaviorType to the IServiceCollection.

    Declaration
    public static ISilverbackBuilder AddSingletonBehavior(this ISilverbackBuilder silverbackBuilder, Type behaviorType)
    Parameters
    Type Name Description
    ISilverbackBuilder silverbackBuilder

    The ISilverbackBuilder that references the IServiceCollection to add the behavior to.

    Type behaviorType

    The type of the behavior to register and the implementation to use.

    Returns
    Type Description
    ISilverbackBuilder

    The ISilverbackBuilder so that additional calls can be chained.

    | Improve this doc View source

    AddSingletonBehavior<TBehavior>(ISilverbackBuilder)

    Adds a singleton behavior of the type specified in TBehavior to the IServiceCollection.

    Declaration
    public static ISilverbackBuilder AddSingletonBehavior<TBehavior>(this ISilverbackBuilder silverbackBuilder) where TBehavior : class, IBehavior
    Parameters
    Type Name Description
    ISilverbackBuilder silverbackBuilder

    The ISilverbackBuilder that references the IServiceCollection to add the behavior to.

    Returns
    Type Description
    ISilverbackBuilder

    The ISilverbackBuilder so that additional calls can be chained.

    Type Parameters
    Name Description
    TBehavior

    The type of the behavior to add.

    | Improve this doc View source

    AddTransientBehavior(ISilverbackBuilder, Func<IServiceProvider, IBehavior>)

    Adds a scoped behavior with a factory specified in implementationFactory to the IServiceCollection.

    Declaration
    public static ISilverbackBuilder AddTransientBehavior(this ISilverbackBuilder silverbackBuilder, Func<IServiceProvider, IBehavior> implementationFactory)
    Parameters
    Type Name Description
    ISilverbackBuilder silverbackBuilder

    The ISilverbackBuilder that references the IServiceCollection to add the behavior to.

    Func<IServiceProvider, IBehavior> implementationFactory

    The factory that creates the service.

    Returns
    Type Description
    ISilverbackBuilder

    The ISilverbackBuilder so that additional calls can be chained.

    | Improve this doc View source

    AddTransientBehavior(ISilverbackBuilder, Type)

    Adds a scoped behavior of the type specified in behaviorType to the IServiceCollection.

    Declaration
    public static ISilverbackBuilder AddTransientBehavior(this ISilverbackBuilder silverbackBuilder, Type behaviorType)
    Parameters
    Type Name Description
    ISilverbackBuilder silverbackBuilder

    The ISilverbackBuilder that references the IServiceCollection to add the behavior to.

    Type behaviorType

    The type of the behavior to register and the implementation to use.

    Returns
    Type Description
    ISilverbackBuilder

    The ISilverbackBuilder so that additional calls can be chained.

    | Improve this doc View source

    AddTransientBehavior<TBehavior>(ISilverbackBuilder)

    Adds a scoped behavior of the type specified in TBehavior to the IServiceCollection.

    Declaration
    public static ISilverbackBuilder AddTransientBehavior<TBehavior>(this ISilverbackBuilder silverbackBuilder) where TBehavior : class, IBehavior
    Parameters
    Type Name Description
    ISilverbackBuilder silverbackBuilder

    The ISilverbackBuilder that references the IServiceCollection to add the behavior to.

    Returns
    Type Description
    ISilverbackBuilder

    The ISilverbackBuilder so that additional calls can be chained.

    Type Parameters
    Name Description
    TBehavior

    The type of the behavior to add.

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