Interface IHostBuilder
- Namespace
- nanoFramework.Hosting
- Assembly
- nanoFramework.Hosting.dll
A program initialization abstraction.
public interface IHostBuilder
- Extension Methods
Properties
Properties
A central location for sharing state between components during the host building process.
object[] Properties { get; set; }
Property Value
- object[]
Methods
Build()
Run the given actions to initialize the host. This can only be called once.
IHost Build()
Returns
Exceptions
- InvalidOperationException
"Build can only be called once."
ConfigureServices(ServiceContextDelegate)
Adds services to the container. This can be called multiple times and the results will be additive.
IHostBuilder ConfigureServices(ServiceContextDelegate configureDelegate)
Parameters
configureDelegate
ServiceContextDelegateThe delegate for configuring the IServiceCollection that will be used to construct the IServiceProvider.
Returns
- IHostBuilder
The same instance of the IHostBuilder for chaining.
UseDefaultServiceProvider(ProviderContextDelegate)
Specify the IServiceProvider to be the default one.
IHostBuilder UseDefaultServiceProvider(ProviderContextDelegate configureDelegate)
Parameters
configureDelegate
ProviderContextDelegateThe delegate for configuring the ServiceProviderOptions that will be used to construct the IServiceProvider.
Returns
- IHostBuilder
The same instance of the IHostBuilder for chaining.