WebHostBuilderExtensions Class¶
- Namespace
Microsoft.AspNetCore.Hosting
- Assemblies
- Microsoft.AspNetCore.Hosting
Syntax¶
public class WebHostBuilderExtensions
-
class
Microsoft.AspNetCore.Hosting.
WebHostBuilderExtensions
Methods¶
-
Configure
(Microsoft.AspNetCore.Hosting.IWebHostBuilder, System.Action<Microsoft.AspNetCore.Builder.IApplicationBuilder>)¶ Specify the startup method to be used to configure the web application.
Arguments: - hostBuilder (Microsoft.AspNetCore.Hosting.IWebHostBuilder) – The
Microsoft.AspNetCore.Hosting.IWebHostBuilder
to configure. - configureApp (System.Action<Microsoft.AspNetCore.Builder.IApplicationBuilder>) – The delegate that configures the
Microsoft.AspNetCore.Builder.IApplicationBuilder
.
Return type: Returns: public static IWebHostBuilder Configure(this IWebHostBuilder hostBuilder, Action<IApplicationBuilder> configureApp)
- hostBuilder (Microsoft.AspNetCore.Hosting.IWebHostBuilder) – The
-
UseStartup
(Microsoft.AspNetCore.Hosting.IWebHostBuilder, System.Type)¶ Specify the startup type to be used by the web host.
Arguments: - hostBuilder (Microsoft.AspNetCore.Hosting.IWebHostBuilder) – The
Microsoft.AspNetCore.Hosting.IWebHostBuilder
to configure. - startupType (System.Type) – The
System.Type
to be used.
Return type: Returns: public static IWebHostBuilder UseStartup(this IWebHostBuilder hostBuilder, Type startupType)
- hostBuilder (Microsoft.AspNetCore.Hosting.IWebHostBuilder) – The
-
UseStartup<TStartup>
(Microsoft.AspNetCore.Hosting.IWebHostBuilder)¶ Specify the startup type to be used by the web host.
Arguments: hostBuilder (Microsoft.AspNetCore.Hosting.IWebHostBuilder) – The Microsoft.AspNetCore.Hosting.IWebHostBuilder
to configure.Return type: Microsoft.AspNetCore.Hosting.IWebHostBuilder Returns: The Microsoft.AspNetCore.Hosting.IWebHostBuilder
.public static IWebHostBuilder UseStartup<TStartup>(this IWebHostBuilder hostBuilder)where TStartup : class
-