Create Method
Definition
- Namespace
- Codebelt.Extensions.Xunit.Hosting
- Assemblies
- Codebelt.Extensions.Xunit.Hosting.dll
Create<TEntryPoint>(Action<IHostBuilder>)
Creates, configures and builds an IHost from the assembly containing TEntryPoint.
public static IHost Create<TEntryPoint>(Action<IHostBuilder> configureHost) where TEntryPoint : class
Parameters
configureHostAction<IHostBuilder>The delegate that provides a way to override the IHostBuilder before the application is built.
Returns
Type Parameters
TEntryPointA type in the entry point assembly of the application.
Remarks
For compatibility, applications that expose CreateHostBuilder(string[]) are built through that factory. Applications that do not expose the legacy factory use the deferred entry-point path. Managed application fixtures use the deferred entry-point path so the application owns startup.
Exceptions
- InvalidOperationException
The entry point assembly does not expose a supported application host.
Create<TEntryPoint>(Action<IHostBuilder>, bool)
Creates, configures and builds an IHost from the assembly containing TEntryPoint.
public static IHost Create<TEntryPoint>(Action<IHostBuilder> configureHost, bool stopApplication) where TEntryPoint : class
Parameters
configureHostAction<IHostBuilder>The delegate that provides a way to override the IHostBuilder before the application is built.
stopApplicationboolA value indicating whether the entry point should be stopped after the host is built.
Returns
Type Parameters
TEntryPointA type in the entry point assembly of the application.
Remarks
For compatibility, applications that expose CreateHostBuilder(string[]) are built through that factory and the stopApplication value is ignored for that path. Managed application fixtures use the deferred entry-point path so the application owns startup.
Exceptions
- InvalidOperationException
The entry point assembly does not expose a supported application host.