Show / Hide Table of Contents

    Class ComponentBuilder<TComponent, TComponentBuilder>

    Provides the abstract base class for the builder class of a Copper component.

    Inheritance
    System.Object
    ComponentBuilder
    ComponentBuilder<TComponent, TComponentBuilder>
    DiscoveryClientBuilder<TDiscoveryClientBuilder>
    DiscoveryClientBuilder<TDiscoveryClientBuilder>
    DiscoveryClientBuilder<TDiscoveryClientBuilder>
    DiscoveryClientBuilder<TDiscoveryClientBuilder>
    DiscoveryClientBuilder<TDiscoveryClientBuilder>
    DiscoveryClientBuilder<TDiscoveryClientBuilder>
    EventPublisherBuilder<TEventPublisherBuilder>
    EventPublisherBuilder<TEventPublisherBuilder>
    EventPublisherBuilder<TEventPublisherBuilder>
    EventPublisherBuilder<TEventPublisherBuilder>
    EventPublisherBuilder<TEventPublisherBuilder>
    EventPublisherBuilder<TEventPublisherBuilder>
    EventReceiverBuilder<TEventReceiverBuilder>
    EventReceiverBuilder<TEventReceiverBuilder>
    EventReceiverBuilder<TEventReceiverBuilder>
    EventReceiverBuilder<TEventReceiverBuilder>
    EventReceiverBuilder<TEventReceiverBuilder>
    EventReceiverBuilder<TEventReceiverBuilder>
    ServiceProxyBuilder<TServiceProxyBuilder>
    ServiceProxyBuilder<TServiceProxyBuilder>
    ServiceProxyBuilder<TServiceProxyBuilder>
    ServiceProxyBuilder<TServiceProxyBuilder>
    ServiceProxyBuilder<TServiceProxyBuilder>
    ServiceProxyBuilder<TServiceProxyBuilder>
    RequestReceiverBuilder<TRequestReceiverBuilder>
    RequestReceiverBuilder<TRequestReceiverBuilder>
    RequestReceiverBuilder<TRequestReceiverBuilder>
    RequestReceiverBuilder<TRequestReceiverBuilder>
    RequestReceiverBuilder<TRequestReceiverBuilder>
    RequestReceiverBuilder<TRequestReceiverBuilder>
    RequestSubmitterBuilder<TRequestSubmitterBuilder>
    RequestSubmitterBuilder<TRequestSubmitterBuilder>
    RequestSubmitterBuilder<TRequestSubmitterBuilder>
    RequestSubmitterBuilder<TRequestSubmitterBuilder>
    RequestSubmitterBuilder<TRequestSubmitterBuilder>
    RequestSubmitterBuilder<TRequestSubmitterBuilder>
    ServiceHostBuilder<TServiceHostBuilder>
    ServiceHostBuilder<TServiceHostBuilder>
    ServiceHostBuilder<TServiceHostBuilder>
    ServiceHostBuilder<TServiceHostBuilder>
    ServiceHostBuilder<TServiceHostBuilder>
    ServiceHostBuilder<TServiceHostBuilder>
    ServiceInstanceListenerBuilder<TServiceInstanceListenerBuilder>
    ServiceInstanceListenerBuilder<TServiceInstanceListenerBuilder>
    ServiceInstanceListenerBuilder<TServiceInstanceListenerBuilder>
    ServiceInstanceListenerBuilder<TServiceInstanceListenerBuilder>
    ServiceInstanceListenerBuilder<TServiceInstanceListenerBuilder>
    ServiceInstanceListenerBuilder<TServiceInstanceListenerBuilder>
    ServiceInstanceProxyFactoryBuilder<TServiceInstanceProxyFactoryBuilder>
    ServiceInstanceProxyFactoryBuilder<TServiceInstanceProxyFactoryBuilder>
    ServiceInstanceProxyFactoryBuilder<TServiceInstanceProxyFactoryBuilder>
    ServiceInstanceProxyFactoryBuilder<TServiceInstanceProxyFactoryBuilder>
    ServiceInstanceProxyFactoryBuilder<TServiceInstanceProxyFactoryBuilder>
    ServiceInstanceProxyFactoryBuilder<TServiceInstanceProxyFactoryBuilder>
    Implements
    System.IDisposable
    Namespace: Copper.Common
    Assembly: Copper.Common.dll
    Syntax
    public abstract class ComponentBuilder<TComponent, TComponentBuilder> : ComponentBuilder, IDisposable where TComponent : class where TComponentBuilder : ComponentBuilder
    Type Parameters
    Name Description
    TComponent

    The component type.

    TComponentBuilder

    The component builder type.

    Constructors

    View Source

    ComponentBuilder()

    Initializes a new instance of the ComponentBuilder<TComponent, TComponentBuilder> class.

    Declaration
    protected ComponentBuilder()

    Methods

    View Source

    Build()

    Builds an instance of TComponent using a DI container constructed from the component builder's configuration. Calling this method more than once will result in multiple instances of TComponent, each built from a separate DI container.

    Declaration
    public TComponent Build()
    Returns
    Type Description
    TComponent

    An instance of TComponent.

    View Source

    BuildComponentServiceProvider()

    Builds and returns a DI container based on the component builder's configuration.

    Declaration
    public IComponentServiceProvider BuildComponentServiceProvider()
    Returns
    Type Description
    IComponentServiceProvider

    The IComponentServiceProvider

    View Source

    Configure(Action<IConfigurationBuilder, ConfigureServices>)

    Sets up the configuration for the remainder of the build process and component. If the component builder has a parent, the configuration builder passed in is the parent component builder's configuration builder. This can be called multiple times and the results will be additive. After all calls have been processed, configuration will be updated with the results for future build steps. The resulting configuration will be available in the component builder's DI container.

    Declaration
    public TComponentBuilder Configure(Action<IConfigurationBuilder, ConfigureServices> configureDelegate)
    Parameters
    Type Name Description
    System.Action<IConfigurationBuilder, ConfigureServices> configureDelegate

    The delegate for configuring the that will be used to construct the for the component. Provides access to additional ConfigureServices that might be useful during configuration.

    Returns
    Type Description
    TComponentBuilder

    The same instance of TComponentBuilder for chaining.

    View Source

    Configure(Action<IConfigurationBuilder>)

    Sets up the configuration for the remainder of the build process and component. If the component builder has a parent, the configuration builder passed in is the parent component builder's configuration builder. This can be called multiple times and the results will be additive. After all calls have been processed, configuration will be updated with the results for future build steps. The resulting configuration will be available in the component builder's DI container.

    Declaration
    public TComponentBuilder Configure(Action<IConfigurationBuilder> configureDelegate)
    Parameters
    Type Name Description
    System.Action<IConfigurationBuilder> configureDelegate

    The delegate for configuring the that will be used to construct the for the component.

    Returns
    Type Description
    TComponentBuilder

    The same instance of TComponentBuilder for chaining.

    View Source

    ConfigureComponentBuilderLogger(Action<ILoggingBuilder>)

    Configures a logger for the remainder of the build process. This can be called multiple times and the results will be additive. If the component builder has a parent, the logger configuration passed in is the parent component builder's logger.

    Declaration
    public TComponentBuilder ConfigureComponentBuilderLogger(Action<ILoggingBuilder> loggerConfigurationAction)
    Parameters
    Type Name Description
    System.Action<ILoggingBuilder> loggerConfigurationAction

    A delegate to configure the .

    Returns
    Type Description
    TComponentBuilder

    The same instance of TComponentBuilder for chaining.

    View Source

    Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

    Declaration
    public void Dispose()
    View Source

    Dispose(Boolean)

    Releases unmanaged and - optionally - managed resources.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    true to release both managed and unmanaged resources; false to release only unmanaged resources.

    View Source

    Register(Action<IServiceCollection, RegisterServices>)

    Adds services to the component builder's DI container. If the component builder has a parent, the service collection passed in is the parent component builder's service collection. This can be called multiple times and the results will be additive.

    Declaration
    public TComponentBuilder Register(Action<IServiceCollection, RegisterServices> registrationAction)
    Parameters
    Type Name Description
    System.Action<IServiceCollection, RegisterServices> registrationAction

    The delegate for registering services on the that will be used to construct the IComponentServiceProvider from which an instance of TComponent can be retrieved. Provides access to additional RegisterServices that might be useful during configuration.

    Returns
    Type Description
    TComponentBuilder

    The same instance of TComponentBuilder for chaining.

    View Source

    Register(Action<IServiceCollection>)

    Adds services to the component builder's DI container. If the component builder has a parent, the service collection passed in is the parent component builder's service collection. This can be called multiple times and the results will be additive.

    Declaration
    public TComponentBuilder Register(Action<IServiceCollection> registrationAction)
    Parameters
    Type Name Description
    System.Action<IServiceCollection> registrationAction

    The delegate for registering services on the that will be used to construct the IComponentServiceProvider from which an instance of TComponent can be retrieved.

    Returns
    Type Description
    TComponentBuilder

    The same instance of TComponentBuilder for chaining.

    View Source

    RegisterChildComponents(Action<IChildComponentConfigurationCollection, RegisterChildComponentsServices>)

    Adds child components to the component builder's. This can be called multiple times and the results will be additive.

    Declaration
    public TComponentBuilder RegisterChildComponents(Action<IChildComponentConfigurationCollection, RegisterChildComponentsServices> componentConfigurationRegistrationAction)
    Parameters
    Type Name Description
    System.Action<IChildComponentConfigurationCollection, RegisterChildComponentsServices> componentConfigurationRegistrationAction

    The delegate for registering child components that will be used to build the component. An instance of the child component's result type will be available in the parent component's DI container. Provides access to additional RegisterChildComponentsServices that might be useful during configuration.

    Returns
    Type Description
    TComponentBuilder

    The same instance of TComponentBuilder for chaining.

    View Source

    RegisterChildComponents(Action<IChildComponentConfigurationCollection>)

    Adds child components to the component builder's. This can be called multiple times and the results will be additive.

    Declaration
    public TComponentBuilder RegisterChildComponents(Action<IChildComponentConfigurationCollection> componentConfigurationRegistrationAction)
    Parameters
    Type Name Description
    System.Action<IChildComponentConfigurationCollection> componentConfigurationRegistrationAction

    The delegate for registering child components that will be used to build the component. An instance of the child component's result type will be available in the parent component's DI container.

    Returns
    Type Description
    TComponentBuilder

    The same instance of TComponentBuilder for chaining.

    View Source

    RegisterOrReplace(String, Action<IServiceCollection>)

    Registers or replaces a named registration action.

    Declaration
    public TComponentBuilder RegisterOrReplace(string registrationActionName, Action<IServiceCollection> registrationAction)
    Parameters
    Type Name Description
    System.String registrationActionName

    The name of the registration action.

    System.Action<IServiceCollection> registrationAction

    The delegate for registering services on the that will be used to construct the IComponentServiceProvider from which an instance of TComponent can be retrieved.

    Returns
    Type Description
    TComponentBuilder

    The same instance of TComponentBuilder for chaining.

    Implements

    System.IDisposable
    • View Source
    Back to top Generated by DocFX