Add HttpResults to the ImplicitUsings of ASP.NET Core projects so TypedResults/Results<T1,T2> don't need an explicit using by sander1095 · Pull Request #47231 · dotnet/sdk (original) (raw)

This issue is related to dotnet/aspnetcore#60337, in which we enrich the webapiaot template with OpenAPI by default, which can be disabled with --no-openapi. In order to write endpoints with correct OpenAPI metadata, TypedResults and Results<T1,T2> are used, which are part of the Microsoft.AspNetCore.Http.HttpResults namespace.

The build of the mentioned PR failed because the usings for the mentioned types were not available. While researching this, I found out that this is because ImplicitUsings for ASP.NET Core projects doesn't add these types.

There are 2 options: