Skip to content

Recommend Minimal APIs for ASP.NET Core 10.0+ - #38010

Open
SkyDevLab wants to merge 3 commits into
dotnet:mainfrom
SkyDevLab:docs/35808-recommend-minimal-apis
Open

SkyDevLab wants to merge 3 commits into
dotnet:mainfrom
SkyDevLab:docs/35808-recommend-minimal-apis

Conversation

@SkyDevLab

@SkyDevLab SkyDevLab commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Strengthens recommendation for Minimal APIs over Controller-based APIs for ASP.NET Core 10.0+ per content team plan.

Fixes #35808


Internal previews

File Preview link
aspnetcore/fundamentals/apis.md Learn preview

Build report

@SkyDevLab
SkyDevLab requested a review from guardrex as a code owner October 26, 2026 17:29
@guardrex guardrex self-assigned this Oct 26, 2026

@guardrex guardrex left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @SkyDevLab!

I'd like to hear back from Genevieve on a few points, and then we'll get on with the final push here. I'll ping Mike for review on this one to make sure it hits everything that he'd like to do.

Comment thread aspnetcore/fundamentals/apis.md Outdated

Minimal APIs support the configuration and customization needed to scale to multiple APIs, handle complex routes, apply authorization rules, and control the content of API responses.

### Getting started with Minimal APIs

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make one change tho because we'd prefer to avoid an unpaired H3. Let's go this way (and you're welcome to change the other instances of this further down the article.

Suggested change
### Getting started with Minimal APIs
Getting started with Minimal APIs:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated as suggested.

Comment thread aspnetcore/fundamentals/apis.md Outdated

* **Tutorial**: <xref:tutorials/min-web-api>
* **Quick reference**: <xref:fundamentals/minimal-apis>
* **Examples**: For a full list of common scenarios with code examples, see <xref:fundamentals/minimal-apis>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is another one that you're welcome to change further down the article if it appears. Because this is a complete sentence, we should have a period at the end of it.

Suggested change
* **Examples**: For a full list of common scenarios with code examples, see <xref:fundamentals/minimal-apis>
* **Examples**: For a full list of common scenarios with code examples, see <xref:fundamentals/minimal-apis>.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated as suggested.

Comment thread aspnetcore/fundamentals/apis.md Outdated

## Controller-based APIs - Alternative approach

While Minimal APIs are recommended, ASP.NET Core also supports a controller-based alternative approach where controllers are classes that derive from <xref:Microsoft.AspNetCore.Mvc.ControllerBase>. This approach follows traditional object-oriented patterns and may be preferred for:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gewarren ... The former content managers didn't care about localization of fragments that lead into lists. Do you want to keep going with their lack of concern about it, or would you prefer that we ... as you said recently ... stick to the style manual as closely as possible? For example here, I'm fleshing out the lead-in sentence that could help MT do a better job. What the former managers would have probably suggested is punctuating the list items as objects of the preposition "for" ... i.e. ... completing the sentence.

Also noting in passing that the list items aren't complete sentences for my suggestion or completing the lead-in sentence, so I'm not punctuating them. We can handle this differently if you prefer.

Suggested change
While Minimal APIs are recommended, ASP.NET Core also supports a controller-based alternative approach where controllers are classes that derive from <xref:Microsoft.AspNetCore.Mvc.ControllerBase>. This approach follows traditional object-oriented patterns and may be preferred for:
While Minimal APIs are recommended, ASP.NET Core also supports a controller-based alternative approach where controllers are classes that derive from <xref:Microsoft.AspNetCore.Mvc.ControllerBase>. This approach follows traditional object-oriented patterns and may be preferred for the following scenarios:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated as suggested.

Comment thread aspnetcore/fundamentals/apis.md Outdated

:::code language="csharp" source="~/fundamentals/apis/APIWithControllers/WeatherForecast.cs":::

## Choosing between approaches

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's avoid the gerund here ... the localization team asked us to avoid them in headings when possible (note that common words, such as 'logging,' are fine).

Suggested change
## Choosing between approaches
## Choose between approaches

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated as suggested.

Comment thread aspnetcore/fundamentals/apis.md Outdated
* **Easier testing** - Simplified unit and integration testing
* **Modern approach** - Leverages the latest .NET features and C# innovations

**Consider controller-based APIs only if you specifically need**:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll complete the sentence and leave the list alone ...

Suggested change
**Consider controller-based APIs only if you specifically need**:
**Consider controller-based APIs only if you specifically need any of the following**:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated as suggested.

Comment thread aspnetcore/fundamentals/apis.md Outdated
Comment on lines +78 to +83
**Start with Minimal APIs for most projects**. They offer:

* **Streamlined experience and simpler syntax** - Less boilerplate code and faster setup
* **Better performance** - Reduced overhead compared to controllers
* **Easier testing** - Simplified unit and integration testing
* **Modern approach** - Leverages the latest .NET features and C# innovations

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gewarren ... This is another case where former management allowed great flexibility to authors. The styles call for just bold and a period. This doc set is full of bold with dashes or colons ... sometimes no bold. It's kind'a all over the place 😄, but at least usually consistent within a single article. Do you want to do anything in particular going forward ... establish a clear convention (e.g., style manual: bold, sentence case, plain text period)? I think it would go like this ...

Suggested change
**Start with Minimal APIs for most projects**. They offer:
* **Streamlined experience and simpler syntax** - Less boilerplate code and faster setup
* **Better performance** - Reduced overhead compared to controllers
* **Easier testing** - Simplified unit and integration testing
* **Modern approach** - Leverages the latest .NET features and C# innovations
**Start with Minimal APIs for most projects**. Minimal APIs offer the following features:
* **Streamlined experience and simpler syntax**. There's less boilerplate code and faster setup.
* **Better performance**. Minimal APIs have reduced overhead compared to controllers.
* **Easier testing**. They simplify unit and integration testing.
* **Modern approach**. The API can leverage the latest .NET features and C# innovations.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated as suggested.

Comment thread aspnetcore/fundamentals/apis.md Outdated
* [Application parts](xref:mvc/extensibility/app-parts) or the [application model](xref:mvc/controllers/application-model)
* [OData](https://www.nuget.org/packages/Microsoft.AspNetCore.OData/) support

Most of these features can be implemented in Minimal APIs with custom solutions, but controllers provide them out of the box.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Most of these features can be implemented in Minimal APIs with custom solutions, but controllers provide them out of the box.
Most of the preceding features can be implemented in Minimal APIs with custom solutions, but controllers provide them natively.

That 'natively' could also be 'automatically' ... 🤔 ... or 'by default.' I'm just not quite feeling that 'out of the box' would be understood in all languages and regions of the world. 😄

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated as suggested.

Comment thread aspnetcore/fundamentals/apis.md Outdated

Most of these features can be implemented in Minimal APIs with custom solutions, but controllers provide them out of the box.

## See also

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## See also
## Related content

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated as suggested.

Comment thread aspnetcore/fundamentals/apis.md Outdated
Comment on lines +96 to +99
* <xref:tutorials/min-web-api> - Minimal API tutorial
* <xref:fundamentals/minimal-apis> - Minimal APIs quick reference
* <xref:web-api/index> - Controller-based APIs overview
* <xref:tutorials/first-web-api> - Controller-based API tutorial

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are obvious from their article titles ...

Suggested change
* <xref:tutorials/min-web-api> - Minimal API tutorial
* <xref:fundamentals/minimal-apis> - Minimal APIs quick reference
* <xref:web-api/index> - Controller-based APIs overview
* <xref:tutorials/first-web-api> - Controller-based API tutorial
* <xref:tutorials/min-web-api>
* <xref:fundamentals/minimal-apis>
* <xref:web-api/index>
* <xref:tutorials/first-web-api>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated as suggested.

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

Labels

None yet

2 participants