Class ServiceProviderFactory.Builder
Represents builder of the service provider.
Implements
Inherited Members
Namespace: DotNext
Assembly: DotNext.dll
Syntax
public sealed class Builder : IConvertible<IServiceProvider>
Methods
| Improve this Doc View SourceAdd<TService>(TService)
Registers service of the specified type.
Declaration
public ServiceProviderFactory.Builder Add<TService>(TService service)
Parameters
Type | Name | Description |
---|---|---|
TService | service | The service instance. |
Returns
Type | Description |
---|---|
ServiceProviderFactory.Builder | This builder for subsequent calls. |
Type Parameters
Name | Description |
---|---|
TService | The type of the service. |
Remarks
This builder doesn't allow registration of multiple services of the same type.
Build(IServiceProvider)
Constructs service provider.
Declaration
public IServiceProvider Build(IServiceProvider fallback = null)
Parameters
Type | Name | Description |
---|---|---|
IServiceProvider | fallback | The fallback provider used for service resolution. |
Returns
Type | Description |
---|---|
IServiceProvider | The constructed service provider. |
Clear()
Clears internal state of this builder and makes it reusable for subsequent calls.
Declaration
public void Clear()
Explicit Interface Implementations
| Improve this Doc View SourceIConvertible<IServiceProvider>.Convert()
Declaration
IServiceProvider IConvertible<IServiceProvider>.Convert()
Returns
Type | Description |
---|---|
IServiceProvider |