Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions aspnetcore/blazor/security/blazor-web-app-with-entra.md
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,10 @@ Obtain the application (client) ID, tenant (publisher) domain, and directory (te

The authentication configuration depends on the type of tenant:

* [ME-ID tenant configuration](#me-id-tenant-configuration)
* [Microsoft Entra External ID configuration](#microsoft-entra-external-id-configuration)
* [Configuration for an ME-ID](#configuration-for-an-me-id)
* [Configuration for Microsoft Entra External ID](#configuration-for-microsoft-entra-external-id)

### ME-ID tenant configuration
### Configuration for an ME-ID

*This section applies to an app registered in a Microsoft Entra ID or Azure AAD B2C tenant.*

Expand Down Expand Up @@ -541,7 +541,7 @@ Example:
List<string> scopes = ["api://11112222-bbbb-3333-cccc-4444dddd5555/Weather.Get"];
```

### Microsoft Entra External ID configuration
### Configuration for Microsoft Entra External ID

*This section applies to an app registered in a Microsoft Entra External ID tenant.*

Expand Down
4 changes: 2 additions & 2 deletions aspnetcore/diagnostics/asp0011.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ uid: diagnostics/asp0011

## Cause

`ConfigureLogging` isn't the recommended strategy for configuring logging in a minimal API application.
`ConfigureLogging` isn't the recommended strategy for configuring logging in a Minimal API application.

## Rule description

`ConfigureLogging` isn't the recommended strategy for configuring logging in a minimal API application.
`ConfigureLogging` isn't the recommended strategy for configuring logging in a Minimal API application.

```csharp
var builder = WebApplication.CreateBuilder(args);
Expand Down
4 changes: 2 additions & 2 deletions aspnetcore/diagnostics/asp0012.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ uid: diagnostics/asp0012

## Cause

`ConfigureServices` isn't the recommended strategy for registering services in DI in a minimal API application.
`ConfigureServices` isn't the recommended strategy for registering services in DI in a Minimal API application.

## Rule description

`ConfigureServices` isn't the recommended strategy for configuring logging in a minimal API application.
`ConfigureServices` isn't the recommended strategy for configuring logging in a Minimal API application.

```csharp
var builder = WebApplication.CreateBuilder(args);
Expand Down
4 changes: 2 additions & 2 deletions aspnetcore/diagnostics/asp0013.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ uid: diagnostics/asp0013

## Cause

<xref:Microsoft.AspNetCore.Hosting.StartupBase.Configure%2A> isn't the recommended strategy for reading and writing to configuration in a minimal API app. `Configure` was designed to be used with [Web Host](/dotnet/api/microsoft.aspnetcore.hosting.iwebhostbuilder) or [.NET Generic Host](/dotnet/core/extensions/generic-host). In a minimal API app, [WebApplicationBuilder.Configuration](xref:Microsoft.AspNetCore.Builder.WebApplicationBuilder.Configuration) should be used to modify configuration directly.
<xref:Microsoft.AspNetCore.Hosting.StartupBase.Configure%2A> isn't the recommended strategy for reading and writing to configuration in a Minimal API app. `Configure` was designed to be used with [Web Host](/dotnet/api/microsoft.aspnetcore.hosting.iwebhostbuilder) or [.NET Generic Host](/dotnet/core/extensions/generic-host). In a Minimal API app, [WebApplicationBuilder.Configuration](xref:Microsoft.AspNetCore.Builder.WebApplicationBuilder.Configuration) should be used to modify configuration directly.

## Rule description

`Configure` isn't the recommended strategy for configuring logging in a minimal API app.
`Configure` isn't the recommended strategy for configuring logging in a Minimal API app.

```csharp
var builder = WebApplication.CreateBuilder(args);
Expand Down
4 changes: 2 additions & 2 deletions aspnetcore/diagnostics/asp0014.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ uid: diagnostics/asp0014

## Cause

Routes can be registered directly at the top-level of a minimal API application.
Routes can be registered directly at the top-level of a Minimal API application.

## Rule description

Routes can be registered directly at the top-level of a minimal API application and don't need to be nested within a `UseEndpoints` call.
Routes can be registered directly at the top-level of a Minimal API application and don't need to be nested within a `UseEndpoints` call.

```csharp
var builder = WebApplication.CreateBuilder(args);
Expand Down
2 changes: 1 addition & 1 deletion aspnetcore/diagnostics/asp0022.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Do not suppress a warning from this rule.

## Notes

[ASP0023](xref:diagnostics/asp0023) warns on route conflicts in ASP.NET Core MVC apps, this analyzer warns on route conflicts in [minimal API](xref:fundamentals/apis) apps.
[ASP0023](xref:diagnostics/asp0023) warns on route conflicts in ASP.NET Core MVC apps, this analyzer warns on route conflicts in [Minimal API](xref:fundamentals/apis) apps.

This analyzer is intentionally conservative about duplicate routes it reports to avoid false positives:

Expand Down
2 changes: 1 addition & 1 deletion aspnetcore/diagnostics/asp0023.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ Do not suppress a warning from this rule.

## Notes

[ASP0022](xref:diagnostics/asp0022) warns on route conflicts in [minimal API](xref:fundamentals/apis) apps, this analyzer warns on route conflicts in ASP.NET Core MVC apps.
[ASP0022](xref:diagnostics/asp0022) warns on route conflicts in [Minimal API](xref:fundamentals/apis) apps, this analyzer warns on route conflicts in ASP.NET Core MVC apps.
4 changes: 2 additions & 2 deletions aspnetcore/fundamentals/aot/native-aot-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ info: Microsoft.Hosting.Lifetime[0]
* <xref:fundamentals/native-aot>
* [Native AOT deployment](/dotnet/core/deploying/native-aot/)
* [Using the configuration binder source generator](https://andrewlock.net/exploring-the-dotnet-8-preview-using-the-new-configuration-binder-source-generator/)
* [The minimal API AOT compilation template](https://andrewlock.net/exploring-the-dotnet-8-preview-the-minimal-api-aot-template/)
* [The Minimal API AOT compilation template](https://andrewlock.net/exploring-the-dotnet-8-preview-the-minimal-api-aot-template/)
* [Comparing `WebApplication.CreateBuilder` to `CreateSlimBuilder`](https://andrewlock.net/exploring-the-dotnet-8-preview-comparing-createbuilder-to-the-new-createslimbuilder-method/)
* [Exploring the new minimal API source generator](https://andrewlock.net/exploring-the-dotnet-8-preview-exploring-the-new-minimal-api-source-generator/)
* [Exploring the new Minimal API source generator](https://andrewlock.net/exploring-the-dotnet-8-preview-exploring-the-new-minimal-api-source-generator/)
* [Replacing method calls with Interceptors](https://andrewlock.net/exploring-the-dotnet-8-preview-changing-method-calls-with-interceptors/)
* [Configuration-binding source generator](/dotnet/core/whats-new/dotnet-8#configuration-binding-source-generator)

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This diagnostic is emitted by the [Request Delegate Generator](/aspnet/core/fund

### Rule description

The implementation of surrogate binding via the [`[AsParameters]`](xref:Microsoft.AspNetCore.Http.AsParametersAttribute) attribute in minimal APIs only supports types with concrete implementations. Using a parameter with an [abstract](/dotnet/csharp/language-reference/keywords/abstract) type as in the following sample produces the diagnostic.
The implementation of surrogate binding via the [`[AsParameters]`](xref:Microsoft.AspNetCore.Http.AsParametersAttribute) attribute in Minimal APIs only supports types with concrete implementations. Using a parameter with an [abstract](/dotnet/csharp/language-reference/keywords/abstract) type as in the following sample produces the diagnostic.

:::code language="csharp" source="~/../AspNetCore.Docs.Samples/fundamentals/aot/diagnostics/Rdg5/Program.cs" id="snippet_1" highlight="13, 17-21"::: Id, string Task);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This diagnostic is emitted by the [Request Delegate Generator](/aspnet/core/fund

### Rule description

The implementation of surrogate binding via the [`[AsParameters]`](xref:Microsoft.AspNetCore.Http.AsParametersAttribute) attribute in minimal APIs only supports types that are not nullable.
The implementation of surrogate binding via the [`[AsParameters]`](xref:Microsoft.AspNetCore.Http.AsParametersAttribute) attribute in Minimal APIs only supports types that are not nullable.

:::code language="csharp" source="~/../AspNetCore.Docs.Samples/fundamentals/aot/diagnostics/Rdg10/Program.cs" id="snippet_1" highlight="13":::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ai-usage: ai-assisted
-->

The ASP.NET Core Request Delegate Generator (RDG) is a compile-time source generator that compiles route handlers provided to a minimal API to request delegates that can be processed by ASP.NET Core's routing infrastructure. The RDG is implicitly enabled when applications are published with AoT enabled or when [trimming is enabled](/dotnet/core/deploying/trimming/trimming-options#enable-trimming). The RDG generates trim and native AoT-friendly code.
The ASP.NET Core Request Delegate Generator (RDG) is a compile-time source generator that compiles route handlers provided to a Minimal API to request delegates that can be processed by ASP.NET Core's routing infrastructure. The RDG is implicitly enabled when applications are published with AoT enabled or when [trimming is enabled](/dotnet/core/deploying/trimming/trimming-options#enable-trimming). The RDG generates trim and native AoT-friendly code.

> [!NOTE]
> * The Native AOT feature is currently in preview.
Expand Down
2 changes: 1 addition & 1 deletion aspnetcore/fundamentals/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ An alternative approach to using <xref:Microsoft.AspNetCore.Http.ProblemDetailsO

:::code language="csharp" source="~/../AspNetCore.Docs.Samples/fundamentals/middleware/problem-details-service/Program.cs" id="snippet_middleware" highlight="5,19-40":::

In the preceding code, the minimal API endpoints `/divide` and `/squareroot` return the expected custom problem response on error input.
In the preceding code, the Minimal API endpoints `/divide` and `/squareroot` return the expected custom problem response on error input.

The API controller endpoints return the default problem response on error input, not the custom problem response. The default problem response is returned because the API controller has written to the response stream, [Problem details for error status codes](/aspnet/core/web-api/#problem-details-for-error-status-codes), before [`IProblemDetailsService.WriteAsync`](https://github.com/dotnet/aspnetcore/blob/ce2db7ea0b161fc5eb35710fca6feeafeeac37bc/src/Http/Http.Extensions/src/ProblemDetailsService.cs#L24) is called and the response is **not** written again.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ An alternative approach to using <xref:Microsoft.AspNetCore.Http.ProblemDetailsO

:::code language="csharp" source="~/../AspNetCore.Docs.Samples/fundamentals/middleware/problem-details-service/Program.cs" id="snippet_middleware" highlight="5,19-40":::

In the preceding code, the minimal API endpoints `/divide` and `/squareroot` return the expected custom problem response on error input.
In the preceding code, the Minimal API endpoints `/divide` and `/squareroot` return the expected custom problem response on error input.

The API controller endpoints return the default problem response on error input, not the custom problem response. The default problem response is returned because the API controller has written to the response stream, [Problem details for error status codes](/aspnet/core/web-api/#problem-details-for-error-status-codes-1), before [`IProblemDetailsService.WriteAsync`](https://github.com/dotnet/aspnetcore/blob/ce2db7ea0b161fc5eb35710fca6feeafeeac37bc/src/Http/Http.Extensions/src/ProblemDetailsService.cs#L24) is called and the response is **not** written again.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ An alternative approach to using <xref:Microsoft.AspNetCore.Http.ProblemDetailsO

:::code language="csharp" source="~/../AspNetCore.Docs.Samples/fundamentals/middleware/problem-details-service/Program.cs" id="snippet_middleware" highlight="5,19-40":::

In the preceding code, the minimal API endpoints `/divide` and `/squareroot` return the expected custom problem response on error input.
In the preceding code, the Minimal API endpoints `/divide` and `/squareroot` return the expected custom problem response on error input.

The API controller endpoints return the default problem response on error input, not the custom problem response. The default problem response is returned because the API controller has written to the response stream, [Problem details for error status codes](/aspnet/core/web-api/#problem-details-for-error-status-codes-1), before [`IProblemDetailsService.WriteAsync`](https://github.com/dotnet/aspnetcore/blob/ce2db7ea0b161fc5eb35710fca6feeafeeac37bc/src/Http/Http.Extensions/src/ProblemDetailsService.cs#L24) is called and the response is **not** written again.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ An alternative approach to using <xref:Microsoft.AspNetCore.Http.ProblemDetailsO

:::code language="csharp" source="~/../AspNetCore.Docs.Samples/fundamentals/middleware/problem-details-service/Program.cs" id="snippet_middleware" highlight="5,19-40":::

In the preceding code, the minimal API endpoints `/divide` and `/squareroot` return the expected custom problem response on error input.
In the preceding code, the Minimal API endpoints `/divide` and `/squareroot` return the expected custom problem response on error input.

The API controller endpoints return the default problem response on error input, not the custom problem response. The default problem response is returned because the API controller has written to the response stream, [Problem details for error status codes](/aspnet/core/web-api/#problem-details-for-error-status-codes), before [`IProblemDetailsService.WriteAsync`](https://github.com/dotnet/aspnetcore/blob/ce2db7ea0b161fc5eb35710fca6feeafeeac37bc/src/Http/Http.Extensions/src/ProblemDetailsService.cs#L24) is called and the response is **not** written again.

Expand Down
4 changes: 2 additions & 2 deletions aspnetcore/fundamentals/http-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ public class HomeController : Controller
}
```

## Access `HttpContext` from minimal APIs
## Access `HttpContext` from Minimal APIs

To use `HttpContext` from minimal APIs, add a `HttpContext` parameter:
To use `HttpContext` from Minimal APIs, add a `HttpContext` parameter:

```csharp
app.MapGet("/", (HttpContext context) => context.Response.WriteAsync("Hello World"));
Expand Down
4 changes: 2 additions & 2 deletions aspnetcore/fundamentals/http-logging/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ Setting <xref:Microsoft.AspNetCore.HttpLogging.HttpLoggingOptions.CombineLogs> t

## Endpoint-specific configuration

For endpoint-specific configuration in minimal API apps, a <xref:Microsoft.AspNetCore.Builder.HttpLoggingEndpointConventionBuilderExtensions.WithHttpLogging%2A> extension method is available. The following example shows how to configure HTTP logging for one endpoint:
For endpoint-specific configuration in Minimal API apps, a <xref:Microsoft.AspNetCore.Builder.HttpLoggingEndpointConventionBuilderExtensions.WithHttpLogging%2A> extension method is available. The following example shows how to configure HTTP logging for one endpoint:

[!code-csharp[](~/fundamentals/http-logging/samples/8.x/Program.cs?name=snippet6)]

For endpoint-specific configuration in apps that use controllers, the [`[HttpLogging]` attribute](xref:Microsoft.AspNetCore.HttpLogging.HttpLoggingAttribute) is available. The attribute can also be used in minimal API apps, as shown in the following example:
For endpoint-specific configuration in apps that use controllers, the [`[HttpLogging]` attribute](xref:Microsoft.AspNetCore.HttpLogging.HttpLoggingAttribute) is available. The attribute can also be used in Minimal API apps, as shown in the following example:

[!code-csharp[](~/fundamentals/http-logging/samples/8.x/Program.cs?name=snippet5)]

Expand Down
2 changes: 1 addition & 1 deletion aspnetcore/fundamentals/minimal-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ The <xref:System.Delegate> arguments passed to these methods are called "route h

[!INCLUDE [](~/fundamentals/minimal-apis/includes/parameter-binding-summary8-10.md)]

## Json+PipeReader deserialization in minimal APIs
## Json+PipeReader deserialization in Minimal APIs

[!INCLUDE [](~/includes/net10pipereader.md)]

Expand Down
10 changes: 5 additions & 5 deletions aspnetcore/fundamentals/minimal-apis/includes/minimal-apis6.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

This document:

* Provides a quick reference for minimal APIs.
* Provides a quick reference for Minimal APIs.
* Is intended for experienced developers. For an introduction, see <xref:tutorials/min-web-api>

The minimal APIs consist of:
The Minimal APIs consist of:

* <xref:Microsoft.AspNetCore.Builder.WebApplication> and <xref:Microsoft.AspNetCore.Builder.WebApplicationBuilder>
* Route handlers
Expand Down Expand Up @@ -267,7 +267,7 @@ For more information, see <xref:fundamentals/middleware/index?view=aspnetcore-6.

## ASP.NET Core Middleware

The following table lists some of the middleware frequently used with minimal APIs.
The following table lists some of the middleware frequently used with Minimal APIs.

| Middleware | Description | API |
|--|--|--|
Expand Down Expand Up @@ -434,7 +434,7 @@ Attributes can be used to explicitly declare where parameters are bound from.

### Parameter binding with DI

Parameter binding for minimal APIs binds parameters through [dependency injection](xref:fundamentals/dependency-injection) when the type is configured as a service. It's not necessary to explicitly apply the [`[FromServices]`](xref:Microsoft.AspNetCore.Mvc.FromServicesAttribute) attribute to a parameter. In the following code, both actions return the time:
Parameter binding for Minimal APIs binds parameters through [dependency injection](xref:fundamentals/dependency-injection) when the type is configured as a service. It's not necessary to explicitly apply the [`[FromServices]`](xref:Microsoft.AspNetCore.Mvc.FromServicesAttribute) attribute to a parameter. In the following code, both actions return the time:

[!code-csharp[](~/release-notes/aspnetcore-7/samples/ApiController/Program.cs?name=snippet_min)]

Expand Down Expand Up @@ -753,6 +753,6 @@ For more information, see <xref:security/cors?view=aspnetcore-6.0>

## See also

[OpenAPI support in minimal APIs](xref:fundamentals/openapi/aspnetcore-openapi)
[OpenAPI support in Minimal APIs](xref:fundamentals/openapi/aspnetcore-openapi)

:::moniker-end
10 changes: 5 additions & 5 deletions aspnetcore/fundamentals/minimal-apis/includes/minimal-apis7.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

This document:

* Provides a quick reference for minimal APIs.
* Provides a quick reference for Minimal APIs.
* Is intended for experienced developers. For an introduction, see <xref:tutorials/min-web-api>

The minimal APIs consist of:
The Minimal APIs consist of:

* [WebApplication and WebApplicationBuilder](xref:fundamentals/minimal-apis/webapplication)
* [Route Handlers](xref:fundamentals/minimal-apis/route-handlers)
Expand All @@ -14,7 +14,7 @@ The minimal APIs consist of:

## ASP.NET Core Middleware

The following table lists some of the middleware frequently used with minimal APIs.
The following table lists some of the middleware frequently used with Minimal APIs.

| Middleware | Description | API |
|--|--|--|
Expand Down Expand Up @@ -165,7 +165,7 @@ We recommend adding an extension method to <xref:Microsoft.AspNetCore.Http.IResu

### Typed results

The <xref:Microsoft.AspNetCore.Http.IResult> interface can represent values returned from minimal APIs that don't utilize the implicit support for JSON serializing the returned object to the HTTP response. The static [Results](/dotnet/api/microsoft.aspnetcore.http.results) class is used to create varying `IResult` objects that represent different types of responses. For example, setting the response status code or redirecting to another URL.
The <xref:Microsoft.AspNetCore.Http.IResult> interface can represent values returned from Minimal APIs that don't utilize the implicit support for JSON serializing the returned object to the HTTP response. The static [Results](/dotnet/api/microsoft.aspnetcore.http.results) class is used to create varying `IResult` objects that represent different types of responses. For example, setting the response status code or redirecting to another URL.

The types implementing `IResult` are public, allowing for type assertions when testing. For example:

Expand Down Expand Up @@ -214,7 +214,7 @@ For more information, see <xref:security/cors?view=aspnetcore-6.0>
<a name="openapi7"></a>

<!--
# Differences between minimal APIs and APIs with controllers
# Differences between Minimal APIs and APIs with controllers

Moved to uid: tutorials/min-web-api
-->
Expand Down
Loading
Loading