Class ServiceHostBuilder<TServiceHostBuilder>
Provides the abstract builder class for a ServiceHost<TServiceHostBuilder>.
Inheritance
Implements
Namespace: Copper.Service
Assembly: Copper.Service.dll
Syntax
public abstract class ServiceHostBuilder<TServiceHostBuilder> : ComponentBuilder<ServiceHost<TServiceHostBuilder>, TServiceHostBuilder>, IDisposable where TServiceHostBuilder : ServiceHostBuilder<TServiceHostBuilder>
Type Parameters
Name | Description |
---|---|
TServiceHostBuilder |
Constructors
View SourceServiceHostBuilder(String)
Initializes a new instance of the ServiceHostBuilder<TServiceHostBuilder> class.
Declaration
protected ServiceHostBuilder(string serviceTypeName)
Parameters
Type | Name | Description |
---|---|---|
System.String | serviceTypeName | The service type name. |
Methods
View SourceAppendServiceInstance(Type)
Appends a service instance to the service host.
Declaration
public TServiceHostBuilder AppendServiceInstance(Type implementationType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | implementationType | The service instance type. |
Returns
Type | Description |
---|---|
TServiceHostBuilder | The same instance of ServiceHostBuilder<TServiceHostBuilder> for chaining. |
AppendServiceInstance<TImplementation>(TImplementation)
Appends a service instance to the service host.
Declaration
public TServiceHostBuilder AppendServiceInstance<TImplementation>(TImplementation instance = null)
where TImplementation : class
Parameters
Type | Name | Description |
---|---|---|
TImplementation | instance | The service instance. |
Returns
Type | Description |
---|---|
TServiceHostBuilder | The same instance of ServiceHostBuilder<TServiceHostBuilder> for chaining. |
Type Parameters
Name | Description |
---|---|
TImplementation | The implementation type. |
AppendServiceInstance<TImplementation>(Func<IServiceProvider, TImplementation>)
Appends a service instance to the service host.
Declaration
public TServiceHostBuilder AppendServiceInstance<TImplementation>(Func<IServiceProvider, TImplementation> implementationFactory)
where TImplementation : class
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.IServiceProvider, TImplementation> | implementationFactory | A factory method to create a service instance. |
Returns
Type | Description |
---|---|
TServiceHostBuilder | The same instance of ServiceHostBuilder<TServiceHostBuilder> for chaining. |
Type Parameters
Name | Description |
---|---|
TImplementation | The implementation type. |
AppendServiceInstance<TImplementation, TServiceInstanceFactory>(TServiceInstanceFactory)
Appends a service instance to the service host.
Declaration
public TServiceHostBuilder AppendServiceInstance<TImplementation, TServiceInstanceFactory>(TServiceInstanceFactory serviceInstanceFactory = null)
where TImplementation : class where TServiceInstanceFactory : class, IServiceInstanceFactory<TImplementation>
Parameters
Type | Name | Description |
---|---|---|
TServiceInstanceFactory | serviceInstanceFactory | An IServiceInstanceFactory<TImplementation> instance. |
Returns
Type | Description |
---|---|
TServiceHostBuilder | The same instance of ServiceHostBuilder<TServiceHostBuilder> for chaining. |
Type Parameters
Name | Description |
---|---|
TImplementation | The implementation type. |
TServiceInstanceFactory | An IServiceInstanceFactory<TImplementation> implementation. |