Background and Motivation
We recently (in .NET 11 Preview 6) added ConfigureHostApplicationBuilder as a new API in Mmvc.Testing library. PR #66527. There is an about question still about the API name, if it should be ConfigureHostApplicationBuilder or ConfigureWebApplicationBuilder
Proposed API
namespace Microsoft.AspNetCore.Mvc.Testing;
public class WebApplicationFactory<TEntryPoint> : IDisposable, IAsyncDisposable where TEntryPoint : class
{
- protected virtual void ConfigureHostApplicationBuilder(IHostApplicationBuilder hostApplicationBuilder);
+ protected virtual void ConfigureWebApplicationBuilder(IHostApplicationBuilder hostApplicationBuilder);
}
Usage Examples
Same as today. This is just a rename. See original proposal for info. #66574
Alternative Designs
Risks
We discussed already the parameter type and agreed it should be IHostApplicationBuilder. So it might sound a bit strange that the method name and parameter name are mismatched. We need to also decide about the exact instance being passed. If it's an internal wrapper, or the real WebApplicationBuilder.
Background and Motivation
We recently (in .NET 11 Preview 6) added
ConfigureHostApplicationBuilderas a new API in Mmvc.Testing library. PR #66527. There is an about question still about the API name, if it should beConfigureHostApplicationBuilderorConfigureWebApplicationBuilderProposed API
namespace Microsoft.AspNetCore.Mvc.Testing; public class WebApplicationFactory<TEntryPoint> : IDisposable, IAsyncDisposable where TEntryPoint : class { - protected virtual void ConfigureHostApplicationBuilder(IHostApplicationBuilder hostApplicationBuilder); + protected virtual void ConfigureWebApplicationBuilder(IHostApplicationBuilder hostApplicationBuilder); }Usage Examples
Same as today. This is just a rename. See original proposal for info. #66574
Alternative Designs
Risks
We discussed already the parameter type and agreed it should be
IHostApplicationBuilder. So it might sound a bit strange that the method name and parameter name are mismatched. We need to also decide about the exact instance being passed. If it's an internal wrapper, or the real WebApplicationBuilder.