Show / Hide Table of Contents

    Class SilverbackBuilderIntegrationExtensions

    Adds the Silverback.Integration specific methods to the SilverbackBuilder.

    Inheritance
    object
    SilverbackBuilderIntegrationExtensions
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: Silverback.Configuration
    Assembly: Silverback.Integration.dll
    Syntax
    public static class SilverbackBuilderIntegrationExtensions

    Methods

    AddBrokerClientsConfigurator(SilverbackBuilder, Func<IServiceProvider, IBrokerClientsConfigurator>)

    Adds an IBrokerClientsConfigurator to be used to setup the producers and consumers.

    Declaration
    public static SilverbackBuilder AddBrokerClientsConfigurator(this SilverbackBuilder builder, Func<IServiceProvider, IBrokerClientsConfigurator> implementationFactory)
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the services to.

    Func<IServiceProvider, IBrokerClientsConfigurator> implementationFactory

    The factory that creates the IBrokerClientsConfigurator to add.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    AddBrokerClientsConfigurator(SilverbackBuilder, Type)

    Adds an IBrokerClientsConfigurator to be used to setup the broker endpoints.

    Declaration
    public static SilverbackBuilder AddBrokerClientsConfigurator(this SilverbackBuilder builder, Type configuratorType)
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the services to.

    Type configuratorType

    The type of the IBrokerClientsConfigurator to add.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    AddBrokerClientsConfigurator<TConfigurator>(SilverbackBuilder)

    Adds an IBrokerClientsConfigurator to be used to setup the broker endpoints.

    Declaration
    public static SilverbackBuilder AddBrokerClientsConfigurator<TConfigurator>(this SilverbackBuilder builder) where TConfigurator : class, IBrokerClientsConfigurator
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the services to.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    Type Parameters
    Name Description
    TConfigurator

    The type of the IBrokerClientsConfigurator to add.

    AddScopedBrokerClientCallback(SilverbackBuilder, Func<IServiceProvider, IBrokerClientCallback>)

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

    Declaration
    public static SilverbackBuilder AddScopedBrokerClientCallback(this SilverbackBuilder builder, Func<IServiceProvider, IBrokerClientCallback> implementationFactory)
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the handler to.

    Func<IServiceProvider, IBrokerClientCallback> implementationFactory

    The factory that creates the service.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    AddScopedBrokerClientCallback(SilverbackBuilder, Type)

    Adds a scoped callback of the type specified in handlerType to the IServiceCollection.

    Declaration
    public static SilverbackBuilder AddScopedBrokerClientCallback(this SilverbackBuilder builder, Type handlerType)
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the handler to.

    Type handlerType

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

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    AddScopedBrokerClientCallback<THandler>(SilverbackBuilder)

    Adds a scoped callback of the type specified in THandler to the IServiceCollection.

    Declaration
    public static SilverbackBuilder AddScopedBrokerClientCallback<THandler>(this SilverbackBuilder builder) where THandler : class, IBrokerClientCallback
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the handler to.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    Type Parameters
    Name Description
    THandler

    The type of the handler to add.

    AddSingletonBrokerBehavior(SilverbackBuilder, IBrokerBehavior)

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

    Declaration
    public static SilverbackBuilder AddSingletonBrokerBehavior(this SilverbackBuilder builder, IBrokerBehavior implementationInstance)
    Parameters
    Type Name Description
    SilverbackBuilder builder

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

    IBrokerBehavior implementationInstance

    The instance of the service.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    AddSingletonBrokerBehavior(SilverbackBuilder, Func<IServiceProvider, IBrokerBehavior>)

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

    Declaration
    public static SilverbackBuilder AddSingletonBrokerBehavior(this SilverbackBuilder builder, Func<IServiceProvider, IBrokerBehavior> implementationFactory)
    Parameters
    Type Name Description
    SilverbackBuilder builder

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

    Func<IServiceProvider, IBrokerBehavior> implementationFactory

    The factory that creates the service.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    AddSingletonBrokerBehavior(SilverbackBuilder, Type)

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

    Declaration
    public static SilverbackBuilder AddSingletonBrokerBehavior(this SilverbackBuilder builder, Type behaviorType)
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder 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
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    AddSingletonBrokerBehavior<TBehavior>(SilverbackBuilder)

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

    Declaration
    public static SilverbackBuilder AddSingletonBrokerBehavior<TBehavior>(this SilverbackBuilder builder) where TBehavior : class, IBrokerBehavior
    Parameters
    Type Name Description
    SilverbackBuilder builder

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

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    Type Parameters
    Name Description
    TBehavior

    The type of the behavior to add.

    AddSingletonBrokerClientCallback(SilverbackBuilder, IBrokerClientCallback)

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

    Declaration
    public static SilverbackBuilder AddSingletonBrokerClientCallback(this SilverbackBuilder builder, IBrokerClientCallback implementationInstance)
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the handler to.

    IBrokerClientCallback implementationInstance

    The instance of the service.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    AddSingletonBrokerClientCallback(SilverbackBuilder, Func<IServiceProvider, IBrokerClientCallback>)

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

    Declaration
    public static SilverbackBuilder AddSingletonBrokerClientCallback(this SilverbackBuilder builder, Func<IServiceProvider, IBrokerClientCallback> implementationFactory)
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the handler to.

    Func<IServiceProvider, IBrokerClientCallback> implementationFactory

    The factory that creates the service.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    AddSingletonBrokerClientCallback(SilverbackBuilder, Type)

    Adds a singleton callback of the type specified in handlerType to the IServiceCollection.

    Declaration
    public static SilverbackBuilder AddSingletonBrokerClientCallback(this SilverbackBuilder builder, Type handlerType)
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the handler to.

    Type handlerType

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

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    AddSingletonBrokerClientCallback<THandler>(SilverbackBuilder)

    Adds a singleton callback of the type specified in THandler to the IServiceCollection.

    Declaration
    public static SilverbackBuilder AddSingletonBrokerClientCallback<THandler>(this SilverbackBuilder builder) where THandler : class, IBrokerClientCallback
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the handler to.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    Type Parameters
    Name Description
    THandler

    The type of the handler to add.

    AddSingletonSequenceReader(SilverbackBuilder, ISequenceReader)

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

    Declaration
    public static SilverbackBuilder AddSingletonSequenceReader(this SilverbackBuilder builder, ISequenceReader implementationInstance)
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the services to.

    ISequenceReader implementationInstance

    The instance of the service.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    AddSingletonSequenceReader(SilverbackBuilder, Func<IServiceProvider, ISequenceReader>)

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

    Declaration
    public static SilverbackBuilder AddSingletonSequenceReader(this SilverbackBuilder builder, Func<IServiceProvider, ISequenceReader> implementationFactory)
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the services to.

    Func<IServiceProvider, ISequenceReader> implementationFactory

    The factory that creates the service.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    AddSingletonSequenceReader(SilverbackBuilder, Type)

    Adds a singleton sequence reader of the type specified in readerType to the IServiceCollection.

    Declaration
    public static SilverbackBuilder AddSingletonSequenceReader(this SilverbackBuilder builder, Type readerType)
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the services to.

    Type readerType

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

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    AddSingletonSequenceReader<TReader>(SilverbackBuilder)

    Adds a singleton sequence reader of the type specified in TReader to the IServiceCollection.

    Declaration
    public static SilverbackBuilder AddSingletonSequenceReader<TReader>(this SilverbackBuilder builder) where TReader : class, ISequenceReader
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the services to.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    Type Parameters
    Name Description
    TReader

    The type of the reader to add.

    AddSingletonSequenceWriter(SilverbackBuilder, ISequenceWriter)

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

    Declaration
    public static SilverbackBuilder AddSingletonSequenceWriter(this SilverbackBuilder builder, ISequenceWriter implementationInstance)
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the services to.

    ISequenceWriter implementationInstance

    The instance of the service.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    AddSingletonSequenceWriter(SilverbackBuilder, Func<IServiceProvider, ISequenceWriter>)

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

    Declaration
    public static SilverbackBuilder AddSingletonSequenceWriter(this SilverbackBuilder builder, Func<IServiceProvider, ISequenceWriter> implementationFactory)
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the services to.

    Func<IServiceProvider, ISequenceWriter> implementationFactory

    The factory that creates the service.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    AddSingletonSequenceWriter(SilverbackBuilder, Type)

    Adds a singleton sequence writer of the type specified in writerType to the IServiceCollection.

    Declaration
    public static SilverbackBuilder AddSingletonSequenceWriter(this SilverbackBuilder builder, Type writerType)
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the services to.

    Type writerType

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

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    AddSingletonSequenceWriter<TWriter>(SilverbackBuilder)

    Adds a singleton sequence writer of the type specified in TWriter to the IServiceCollection.

    Declaration
    public static SilverbackBuilder AddSingletonSequenceWriter<TWriter>(this SilverbackBuilder builder) where TWriter : class, ISequenceWriter
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the services to.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    Type Parameters
    Name Description
    TWriter

    The type of the writer to add.

    AddTransientBrokerBehavior(SilverbackBuilder, Func<IServiceProvider, IBrokerBehavior>)

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

    Declaration
    public static SilverbackBuilder AddTransientBrokerBehavior(this SilverbackBuilder builder, Func<IServiceProvider, IBrokerBehavior> implementationFactory)
    Parameters
    Type Name Description
    SilverbackBuilder builder

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

    Func<IServiceProvider, IBrokerBehavior> implementationFactory

    The factory that creates the service.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    AddTransientBrokerBehavior(SilverbackBuilder, Type)

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

    Declaration
    public static SilverbackBuilder AddTransientBrokerBehavior(this SilverbackBuilder builder, Type behaviorType)
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder 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
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    AddTransientBrokerBehavior<TBehavior>(SilverbackBuilder)

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

    Declaration
    public static SilverbackBuilder AddTransientBrokerBehavior<TBehavior>(this SilverbackBuilder builder) where TBehavior : class, IBrokerBehavior
    Parameters
    Type Name Description
    SilverbackBuilder builder

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

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    Type Parameters
    Name Description
    TBehavior

    The type of the behavior to add.

    AddTransientBrokerClientCallback(SilverbackBuilder, Func<IServiceProvider, IBrokerClientCallback>)

    Adds a transient callback with a factory specified in implementationFactory to the IServiceCollection.

    Declaration
    public static SilverbackBuilder AddTransientBrokerClientCallback(this SilverbackBuilder builder, Func<IServiceProvider, IBrokerClientCallback> implementationFactory)
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the handler to.

    Func<IServiceProvider, IBrokerClientCallback> implementationFactory

    The factory that creates the service.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    AddTransientBrokerClientCallback(SilverbackBuilder, Type)

    Adds a transient callback of the type specified in handlerType to the IServiceCollection.

    Declaration
    public static SilverbackBuilder AddTransientBrokerClientCallback(this SilverbackBuilder builder, Type handlerType)
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the handler to.

    Type handlerType

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

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    AddTransientBrokerClientCallback<THandler>(SilverbackBuilder)

    Adds a transient callback of the type specified in THandler to the IServiceCollection.

    Declaration
    public static SilverbackBuilder AddTransientBrokerClientCallback<THandler>(this SilverbackBuilder builder) where THandler : class, IBrokerClientCallback
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the handler to.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    Type Parameters
    Name Description
    THandler

    The type of the handler to add.

    AddTransientSequenceReader(SilverbackBuilder, Func<IServiceProvider, ISequenceReader>)

    Adds a transient sequence reader with a factory specified in implementationFactory to the IServiceCollection.

    Declaration
    public static SilverbackBuilder AddTransientSequenceReader(this SilverbackBuilder builder, Func<IServiceProvider, ISequenceReader> implementationFactory)
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the services to.

    Func<IServiceProvider, ISequenceReader> implementationFactory

    The factory that creates the service.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    AddTransientSequenceReader(SilverbackBuilder, Type)

    Adds a transient sequence reader of the type specified in readerType to the IServiceCollection.

    Declaration
    public static SilverbackBuilder AddTransientSequenceReader(this SilverbackBuilder builder, Type readerType)
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the services to.

    Type readerType

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

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    AddTransientSequenceReader<TReader>(SilverbackBuilder)

    Adds a transient sequence reader of the type specified in TReader to the IServiceCollection.

    Declaration
    public static SilverbackBuilder AddTransientSequenceReader<TReader>(this SilverbackBuilder builder) where TReader : class, ISequenceReader
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the services to.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    Type Parameters
    Name Description
    TReader

    The type of the reader to add.

    AddTransientSequenceWriter(SilverbackBuilder, Func<IServiceProvider, ISequenceWriter>)

    Adds a transient sequence writer with a factory specified in implementationFactory to the IServiceCollection.

    Declaration
    public static SilverbackBuilder AddTransientSequenceWriter(this SilverbackBuilder builder, Func<IServiceProvider, ISequenceWriter> implementationFactory)
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the services to.

    Func<IServiceProvider, ISequenceWriter> implementationFactory

    The factory that creates the service.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    AddTransientSequenceWriter(SilverbackBuilder, Type)

    Adds a transient sequence writer of the type specified in writerType to the IServiceCollection.

    Declaration
    public static SilverbackBuilder AddTransientSequenceWriter(this SilverbackBuilder builder, Type writerType)
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the services to.

    Type writerType

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

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    AddTransientSequenceWriter<TWriter>(SilverbackBuilder)

    Adds a transient sequence writer of the type specified in TWriter to the IServiceCollection.

    Declaration
    public static SilverbackBuilder AddTransientSequenceWriter<TWriter>(this SilverbackBuilder builder) where TWriter : class, ISequenceWriter
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the services to.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    Type Parameters
    Name Description
    TWriter

    The type of the writer to add.

    EnableStorage(SilverbackBuilder)

    Registers the types needed to use some storage (e.g. a database for the outbox).

    Declaration
    public static SilverbackBuilder EnableStorage(this SilverbackBuilder builder)
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the services to.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    Remarks

    This method is called implicitly by WithConnectionToMessageBroker(SilverbackBuilder, Action<BrokerOptionsBuilder>?).

    WithConnectionToMessageBroker(SilverbackBuilder, Action<BrokerOptionsBuilder>?)

    Registers the types needed to connect with a message broker.

    Declaration
    public static SilverbackBuilder WithConnectionToMessageBroker(this SilverbackBuilder builder, Action<BrokerOptionsBuilder>? optionsAction = null)
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder that references the IServiceCollection to add the services to.

    Action<BrokerOptionsBuilder> optionsAction

    Additional options such as the actual message brokers to be used.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    WithCustomHeaderName(SilverbackBuilder, string, string)

    Adds a new header mapping.

    Declaration
    public static SilverbackBuilder WithCustomHeaderName(this SilverbackBuilder builder, string defaultHeaderName, string customHeaderName)
    Parameters
    Type Name Description
    SilverbackBuilder builder

    The SilverbackBuilder.

    string defaultHeaderName

    The default header name.

    string customHeaderName

    The custom header name to be used instead of the default.

    Returns
    Type Description
    SilverbackBuilder

    The SilverbackBuilder so that additional calls can be chained.

    GitHub E-Mail
    ↑ Back to top © 2026 Sergio Aquilini