HostBuilderApplicationExtensions Class
Definition
- Namespace
- Codebelt.Extensions.Xunit.Hosting.AspNetCore
- Assemblies
- Codebelt.Extensions.Xunit.Hosting.AspNetCore.dll
Provides extension methods for IHostApplicationBuilder.
public static class HostBuilderApplicationExtensions
- Inheritance
-
HostBuilderApplicationExtensions
Examples
The following example converts an IHostApplicationBuilder to an IHostBuilder by calling ToHostBuilder. This is useful when working with ASP.NET Core minimal API hosts where the IHostApplicationBuilder provides access to the underlying IHostBuilder for advanced configuration.
using Codebelt.Extensions.Xunit.Hosting.AspNetCore;
using Microsoft.Extensions.Hosting;
namespace WebFixtureTests;
public class BuilderConverter
{
public IHostBuilder Convert(IHostApplicationBuilder builder)
{
return builder.ToHostBuilder();
}
}
Methods
| Name | Description |
|---|---|
| ToHostBuilder(IHostApplicationBuilder) | Converts an IHostApplicationBuilder to an IHostBuilder. |