Class MyWebHostBuilder
Implements
Inherited Members
Namespace: Coree.NETASP.UnderConstruction
Assembly: Coree.NETASP.dll
Syntax
public class MyWebHostBuilder : IWebHostBuilder
Constructors
| Edit this page View SourceMyWebHostBuilder()
Declaration
public MyWebHostBuilder()
Properties
| Edit this page View SourceServicesx
Declaration
public IServiceCollection Servicesx { get; }
Property Value
Type | Description |
---|---|
IServiceCollection |
Methods
| Edit this page View SourceBuild()
Builds an IWebHost which hosts a web application.
Declaration
public IWebHost Build()
Returns
Type | Description |
---|---|
IWebHost |
Buildx()
Declaration
public IWebHost Buildx()
Returns
Type | Description |
---|---|
IWebHost |
ConfigureAppConfiguration(Action<WebHostBuilderContext, IConfigurationBuilder>)
Adds a delegate for configuring the IConfigurationBuilder that will construct an IConfiguration.
Declaration
public IWebHostBuilder ConfigureAppConfiguration(Action<WebHostBuilderContext, IConfigurationBuilder> configureDelegate)
Parameters
Type | Name | Description |
---|---|---|
Action<WebHostBuilderContext, IConfigurationBuilder> | configureDelegate | The delegate for configuring the IConfigurationBuilder that will be used to construct an IConfiguration. |
Returns
Type | Description |
---|---|
IWebHostBuilder | The IWebHostBuilder. |
Remarks
The IConfiguration and ILoggerFactory on the WebHostBuilderContext are uninitialized at this stage. The IConfigurationBuilder is pre-populated with the settings of the IWebHostBuilder.
ConfigureServices(Action<WebHostBuilderContext, IServiceCollection>)
Adds a delegate for configuring additional services for the host or web application. This may be called multiple times.
Declaration
public IWebHostBuilder ConfigureServices(Action<WebHostBuilderContext, IServiceCollection> configureServices)
Parameters
Type | Name | Description |
---|---|---|
Action<WebHostBuilderContext, IServiceCollection> | configureServices | A delegate for configuring the IServiceCollection. |
Returns
Type | Description |
---|---|
IWebHostBuilder | The IWebHostBuilder. |
ConfigureServices(Action<IServiceCollection>)
Adds a delegate for configuring additional services for the host or web application. This may be called multiple times.
Declaration
public IWebHostBuilder ConfigureServices(Action<IServiceCollection> configureServices)
Parameters
Type | Name | Description |
---|---|---|
Action<IServiceCollection> | configureServices | A delegate for configuring the IServiceCollection. |
Returns
Type | Description |
---|---|
IWebHostBuilder | The IWebHostBuilder. |
GetSetting(string)
Get the setting value from the configuration.
Declaration
public string? GetSetting(string key)
Parameters
Type | Name | Description |
---|---|---|
string | key | The key of the setting to look up. |
Returns
Type | Description |
---|---|
string | The value the setting currently contains. |
UseSetting(string, string?)
Add or replace a setting in the configuration.
Declaration
public IWebHostBuilder UseSetting(string key, string? value)
Parameters
Type | Name | Description |
---|---|---|
string | key | The key of the setting to add or replace. |
string | value | The value of the setting to add or replace. |
Returns
Type | Description |
---|---|
IWebHostBuilder | The IWebHostBuilder. |