Skip to content

Consider renaming ConfigureHostApplicationBuilder to ConfigureWebApplicationBuilder #67393

Description

@Youssef1313

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

api-approvedAPI was approved in API review, it can be implementedarea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesfeature-mvc-testingMVC testing package

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions