You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aspnetcore/performance/ObjectPool/includes/ObjectPool6.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ Important `ObjectPool` types and interfaces:
36
36
*<xref:Microsoft.Extensions.ObjectPool.ObjectPool`1> : The basic object pool abstraction. Used to get and return objects.
37
37
*<xref:Microsoft.Extensions.ObjectPool.PooledObjectPolicy%601> : Implement this to customize how an object is created and how it is reset when returned to the pool. This can be passed into an object pool that is construct directly, or
38
38
*<xref:Microsoft.Extensions.ObjectPool.ObjectPoolProvider.Create*> : Acts as a factory for creating object pools.
39
-
*[IResettable](https://source.dot.net/#Microsoft.Extensions.ObjectPool/IResettable.cs,9f0c03a4187b92ca,references): Automatically resets the object when returned to an object pool.
39
+
*<xref:Microsoft.Extensions.ObjectPool.IResettable>: Automatically resets the object when returned to an object pool.
40
40
41
41
The ObjectPool can be used in an app in multiple ways:
Add the `HybridCache` service to the [dependency injection (DI)](xref:fundamentals/dependency-injection) container by calling [`AddHybridCache`](https://source.dot.net/#Microsoft.Extensions.Caching.Hybrid/HybridCacheServiceExtensions.cs,2c4a0de52ec7387c):
32
+
Add the `HybridCache` service to the [dependency injection (DI)](xref:fundamentals/dependency-injection) container by calling <xref:Microsoft.Extensions.DependencyInjection.HybridCacheServiceExtensions.AddHybridCache%2A>:
The preceding code registers the `HybridCache` service with default options. The registration API can also configure [options](#options) and [serialization](#serialization).
37
37
38
38
## Get and store cache entries
39
39
40
-
The `HybridCache` service provides a [`GetOrCreateAsync`](https://source.dot.net/#Microsoft.Extensions.Caching.Hybrid/Runtime/HybridCache.cs,990ceb8b6f2999f7) method with two overloads, taking a key and:
40
+
The `HybridCache` service provides a <xref:Microsoft.Extensions.Caching.Hybrid.HybridCache.GetOrCreateAsync%2A> method with two overloads, taking a key and:
41
41
42
42
* A factory method.
43
43
* State, and a factory method.
@@ -104,14 +104,14 @@ The alternative overload might reduce some overhead from [captured variables](/d
104
104
105
105
### The `SetAsync` method
106
106
107
-
In many scenarios, `GetOrCreateAsync` is the only API needed. But `HybridCache` also has [`SetAsync`](https://source.dot.net/#Microsoft.Extensions.Caching.Hybrid/Internal/DefaultHybridCache.cs,ed5c0ddff676c5f2) to store an object in cache without trying to retrieve it first.
107
+
In many scenarios, `GetOrCreateAsync` is the only API needed. But `HybridCache` also has <xref:Microsoft.Extensions.Caching.Hybrid.HybridCache.SetAsync%2A> to store an object in cache without trying to retrieve it first.
108
108
<!--
109
109
Add GetAsync when it's implemented.
110
110
-->
111
111
112
112
## Remove cache entries by key
113
113
114
-
When the underlying data for a cache entry changes before it expires, remove the entry explicitly by calling [`RemoveAsync`](https://source.dot.net/#Microsoft.Extensions.Caching.Hybrid/Internal/DefaultHybridCache.cs,a1f8d27e085182cc) with the key to the entry. An [overload](https://source.dot.net/#Microsoft.Extensions.Caching.Hybrid/Runtime/HybridCache.cs,bc261d181c479a57) lets you specify a collection of key values.
114
+
When the underlying data for a cache entry changes before it expires, remove the entry explicitly by calling <xref:Microsoft.Extensions.Caching.Hybrid.HybridCache.RemoveAsync%2A> with the key to the entry. An overload lets you specify a collection of key values.
115
115
116
116
When an entry is removed, it is removed from both the primary and secondary caches.
117
117
@@ -126,7 +126,7 @@ Set tags when calling `GetOrCreateAsync`, as shown in the following example:
Remove all entries for a specified tag by calling [`RemoveByTagAsync`](https://source.dot.net/#Microsoft.Extensions.Caching.Hybrid/Runtime/HybridCache.cs,c37a54f5e962ab23) with the tag value. An [overload](https://source.dot.net/#Microsoft.Extensions.Caching.Hybrid/Runtime/HybridCache.cs,9efbe8770df53e9c) lets you specify a collection of tag values.
129
+
Remove all entries for a specified tag by calling <xref:Microsoft.Extensions.Caching.Hybrid.HybridCache.RemoveByTagAsync%2A> with the tag value. An overload lets you specify a collection of tag values.
130
130
131
131
When an entry is removed, it is removed from both the primary and secondary caches.
132
132
@@ -142,8 +142,8 @@ The `GetOrCreateAsync` method can also take a `HybridCacheEntryOptions` object t
142
142
143
143
For more information about the options, see the source code:
@@ -154,7 +154,7 @@ The following properties of `HybridCacheOptions` let you configure limits that a
154
154
155
155
## Serialization
156
156
157
-
Use of a secondary, out-of-process cache requires serialization. Serialization is configured as part of registering the `HybridCache` service. Type-specific and general-purpose serializers can be configured via the [`AddSerializer`](https://source.dot.net/#Microsoft.Extensions.Caching.Hybrid/HybridCacheBuilderExtensions.cs,954f74a7592cc282) and [`AddSerializerFactory`](https://source.dot.net/#Microsoft.Extensions.Caching.Hybrid/HybridCacheBuilderExtensions.cs,ba940d95d06485ca) methods, chained from the `AddHybridCache` call. By default, the library
157
+
Use of a secondary, out-of-process cache requires serialization. Serialization is configured as part of registering the `HybridCache` service. Type-specific and general-purpose serializers can be configured via the <xref:Microsoft.Extensions.DependencyInjection.HybridCacheBuilderExtensions.AddSerializer%2A> and <xref:Microsoft.Extensions.DependencyInjection.HybridCacheBuilderExtensions.AddSerializerFactory%2A> methods, chained from the `AddHybridCache` call. By default, the library
158
158
handles `string` and `byte[]` internally, and uses `System.Text.Json` for everything else. `HybridCache` can also use other serializers, such as protobuf or XML.
159
159
160
160
The following example configures the service to use a type-specific protobuf serializer:
@@ -217,7 +217,7 @@ In such cases, inform `HybridCache` that it's safe to reuse instances by:
217
217
218
218
### Avoid `byte[]` allocations
219
219
220
-
`HybridCache` also provides optional APIs for `IDistributedCache` implementations, to avoid `byte[]` allocations. This feature is implemented by the preview versions of the `Microsoft.Extensions.Caching.StackExchangeRedis` and `Microsoft.Extensions.Caching.SqlServer` packages. For more information, see [IBufferDistributedCache](https://source.dot.net/#Microsoft.Extensions.Caching.Hybrid/Runtime/IBufferDistributedCache.cs,df9fb366340929b1)
220
+
`HybridCache` also provides optional APIs for `IDistributedCache` implementations, to avoid `byte[]` allocations. This feature is implemented by the preview versions of the `Microsoft.Extensions.Caching.StackExchangeRedis` and `Microsoft.Extensions.Caching.SqlServer` packages. For more information, see <xref:Microsoft.Extensions.Caching.Distributed.IBufferDistributedCache>.
221
221
Here are the .NET CLI commands to install the packages:
222
222
223
223
```dotnetcli
@@ -241,4 +241,4 @@ The `HybridCache` library supports older .NET runtimes, down to .NET Framework 4
241
241
For more information about `HybridCache`, see the following resources:
Copy file name to clipboardExpand all lines: aspnetcore/performance/caching/hybrid/includes/overview.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
The [`HybridCache`](https://source.dot.net/#Microsoft.Extensions.Caching.Hybrid/Runtime/HybridCache.cs,8c0fe94693d1ac8d) API bridges some gaps in the <xref:Microsoft.Extensions.Caching.Distributed.IDistributedCache> and <xref:Microsoft.Extensions.Caching.Memory.IMemoryCache> APIs. `HybridCache` is an abstract class with a default implementation that handles most aspects of saving to cache and retrieving from cache.
1
+
The <xref:Microsoft.Extensions.Caching.Hybrid.HybridCache> API bridges some gaps in the <xref:Microsoft.Extensions.Caching.Distributed.IDistributedCache> and <xref:Microsoft.Extensions.Caching.Memory.IMemoryCache> APIs. `HybridCache` is an abstract class with a default implementation that handles most aspects of saving to cache and retrieving from cache.
2
2
3
3
### Features
4
4
@@ -82,5 +82,5 @@ The `HybridCache` library supports older .NET runtimes, down to .NET Framework 4
82
82
For more information, see the following resources:
Copy file name to clipboardExpand all lines: aspnetcore/release-notes/aspnetcore-8.0.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -781,7 +781,7 @@ ASP.NET Core 8 adds new features to authentication and authorization.
781
781
782
782
### Identity API endpoints
783
783
784
-
[`MapIdentityApi<TUser>`](https://source.dot.net/#Microsoft.AspNetCore.Identity/IdentityApiEndpointRouteBuilderExtensions.cs,32) is a new extension method that adds two API endpoints (`/register` and `/login`). The main goal of the `MapIdentityApi` is to make it easy for developers to use ASP.NET Core Identity for authentication in JavaScript-based single page apps (SPA) or Blazor apps. Instead of using the default UI provided by ASP.NET Core Identity, which is based on Razor Pages, MapIdentityApi adds JSON API endpoints that are more suitable for SPA apps and nonbrowser apps. For more information, see [Identity API endpoints](https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-dotnet-8-preview-4/#identity-api-endpoints).
784
+
[`MapIdentityApi<TUser>`](xref:Microsoft.AspNetCore.Routing.IdentityApiEndpointRouteBuilderExtensions.MapIdentityApi%2A) isanewextensionmethodthataddstwoAPIendpoints (`/register` and `/login`). Themaingoalofthe `MapIdentityApi` istomakeiteasyfordeveloperstouseASP.NETCoreIdentityforauthenticationinJavaScript-basedsinglepageapps (SPA) orBlazorapps. InsteadofusingthedefaultUIprovidedbyASP.NETCoreIdentity, whichisbasedonRazorPages, MapIdentityApiaddsJSONAPIendpointsthataremoresuitableforSPAappsandnonbrowserapps. Formoreinformation, see [IdentityAPIendpoints](https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-dotnet-8-preview-4/#identity-api-endpoints).
785
785
786
786
### IAuthorizationRequirementData
787
787
@@ -957,9 +957,9 @@ Metrics have been added for ASP.NET Core hosting, Kestrel, and SignalR. For more
957
957
958
958
### IExceptionHandler
959
959
960
-
[IExceptionHandler](https://source.dot.net/#Microsoft.AspNetCore.Diagnostics/ExceptionHandler/IExceptionHandler.cs,adae2915ad0c6dc5) is a new interface that gives the developer a callback for handling known exceptions in a central location.
`IExceptionHandler` implementationsareregisteredbycalling [`IServiceCollection.AddExceptionHandler<T>`](https://source.dot.net/#Microsoft.AspNetCore.Diagnostics/ExceptionHandler/ExceptionHandlerServiceCollectionExtensions.cs,e74aac24e3e2cbc9). Multiple implementations can be added, and they're called in the order registered. If an exception handler handles a request, it can return `true` to stop processing. If an exception isn't handled by any exception handler, then control falls back to the default behavior and options from the middleware.
962
+
`IExceptionHandler` implementationsareregisteredbycalling [`IServiceCollection.AddExceptionHandler<T>`](xref:Microsoft.Extensions.DependencyInjection.ExceptionHandlerServiceCollectionExtensions.AddExceptionHandler%2A). Multipleimplementationscanbeadded, andthey're called in the order registered. If an exception handler handles a request, it can return `true` to stop processing. If an exception isn'thandledbyanyexceptionhandler, thencontrolfallsbacktothedefaultbehaviorandoptionsfromthemiddleware.
963
963
964
964
Formoreinformation, see [IExceptionHandler](xref:fundamentals/error-handling#iexceptionhandler).
Copy file name to clipboardExpand all lines: aspnetcore/release-notes/aspnetcore-9/includes/hybrid-cache.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ ms.date: 05/21/2024
9
9
> [!IMPORTANT]
10
10
> `HybridCache` is currently still in preview but will be fully released *after* .NET 9.0 in a future minor release of .NET Extensions.
11
11
12
-
The [`HybridCache`](https://source.dot.net/#Microsoft.Extensions.Caching.Hybrid/Runtime/HybridCache.cs,8c0fe94693d1ac8d) API bridges some gaps in the existing <xref:Microsoft.Extensions.Caching.Distributed.IDistributedCache> and <xref:Microsoft.Extensions.Caching.Memory.IMemoryCache> APIs. It also adds new capabilities, such as:
12
+
The <xref:Microsoft.Extensions.Caching.Hybrid.HybridCache> API bridges some gaps in the existing <xref:Microsoft.Extensions.Caching.Distributed.IDistributedCache> and <xref:Microsoft.Extensions.Caching.Memory.IMemoryCache> APIs. It also adds new capabilities, such as:
13
13
14
14
***"Stampede" protection** to prevent parallel fetches of the same work.
Copy file name to clipboardExpand all lines: aspnetcore/release-notes/aspnetcore-9/includes/openAPI_completion.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ ASP.NET Core's OpenAPI support is now more accessible and user-friendly. The Ope
4
4
5
5
Recognizing this gap, we have introduced a new completion provider and code fixer. These tools are designed to facilitate the discovery and use of OpenAPI APIs, making it easier for developers to integrate OpenAPI into their projects. The completion provider offers real-time code suggestions, while the code fixer assists in correcting common mistakes and improving API usage. This enhancement is part of our ongoing commitment to improve the developer experience and streamline API-related workflows.
6
6
7
-
When a user types a statement where an OpenAPI-related API is available, the completion provider displays a recommendation for the API. For example, in the following screenshots, completions for [AddOpenApi](https://source.dot.net/#Microsoft.AspNetCore.OpenApi/Extensions/OpenApiServiceCollectionExtensions.cs,61) and [MapOpenApi](https://source.dot.net/#Microsoft.AspNetCore.OpenApi/Extensions/OpenApiEndpointRouteBuilderExtensions.cs,da6124cfb6e2f8d8) are provided when a user is entering an invocation statement on a supported type, such as [IEndpointConventionBuilder](/dotnet/api/microsoft.aspnetcore.builder.iendpointconventionbuilder):
7
+
When a user types a statement where an OpenAPI-related API is available, the completion provider displays a recommendation for the API. For example, in the following screenshots, completions for <xref:Microsoft.Extensions.DependencyInjection.OpenApiServiceCollectionExtensions.AddOpenApi> and <xref:Microsoft.AspNetCore.Builder.OpenApiEndpointRouteBuilderExtensions.MapOpenApi> are provided when a user is entering an invocation statement on a supported type, such as <xref:Microsoft.AspNetCore.Builder.IEndpointConventionBuilder>:
### Support for schema transformers on OpenAPI documents
80
80
81
-
Built-in OpenAPI support now ships with support for schema transformers that can be used to modify schemas generated by [System.Text.Json](/dotnet/api/system.text.json) and the OpenAPI implementation. Like document and operation transformers, schema transformers can be registered on the [OpenApiOptions](https://source.dot.net/#Microsoft.AspNetCore.OpenApi/Services/OpenApiOptions.cs,c0a8b420f4ce6918) object. For example, the following code sample demonstrates using a schema transformer to add an example to a type's schema.
81
+
Built-in OpenAPI support now ships with support for schema transformers that can be used to modify schemas generated by <xref:System.Text.Json?displayProperty=fullName> and the OpenAPI implementation. Like document and operation transformers, schema transformers can be registered on the <xref:Microsoft.AspNetCore.OpenApi.OpenApiOptions> object. For example, the following code sample demonstrates using a schema transformer to add an example to a type's schema.
Copy file name to clipboardExpand all lines: aspnetcore/release-notes/aspnetcore-9/includes/opt_out_metrics.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,8 @@
4
4
5
5
HTTP requests to an endpoint can be excluded from metrics by adding metadata. Either:
6
6
7
-
* Add the [`[DisableHttpMetrics]`](https://source.dot.net/#Microsoft.AspNetCore.Http.Extensions/DisableHttpMetricsAttribute.cs,258cd11ebe5f2ee1) attribute to the Web API controller, SignalR hub or gRPC service.
8
-
* Call [DisableHttpMetrics](https://source.dot.net/#Microsoft.AspNetCore.Http.Extensions/HttpMetricsEndpointConventionBuilderExtensions.cs,7537104878c6f44a) when mapping endpoints in app startup:
7
+
* Add the [`[DisableHttpMetrics]` attribute](xref:Microsoft.AspNetCore.Http.DisableHttpMetricsAttribute) to the Web API controller, SignalR hub or gRPC service.
8
+
* Call <xref:Microsoft.AspNetCore.Builder.HttpMetricsEndpointConventionBuilderExtensions.DisableHttpMetrics%2A> when mapping endpoints in app startup:
* Does ***not*** short-circuit the execution of the rest of the request pipeline.
280
-
* Sets the [IAntiforgeryValidationFeature](https://source.dot.net/#Microsoft.AspNetCore.Http.Features/IAntiforgeryValidationFeature.cs,33a7a0e106f11c6f) in the [HttpContext.Features](xref:Microsoft.AspNetCore.Http.HttpContext.Features) of the current request.
280
+
* Sets the <xref:Microsoft.AspNetCore.Antiforgery.IAntiforgeryValidationFeature> in the <xref:Microsoft.AspNetCore.Http.HttpContext.Features%2A?displayProperty=nameWithType> of the current request.
281
281
282
282
The antiforgery token is only validated if:
283
283
284
-
* The endpoint contains metadata implementing [IAntiforgeryMetadata](https://source.dot.net/#Microsoft.AspNetCore.Http.Abstractions/Metadata/IAntiforgeryMetadata.cs,5f49d4d07fc58320) where `RequiresValidation=true`.
284
+
* The endpoint contains metadata implementing <xref:Microsoft.AspNetCore.Antiforgery.IAntiforgeryMetadata> where `RequiresValidation=true`.
285
285
* The HTTP method associated with the endpoint is a relevant [HTTP method](https://developer.mozilla.org/docs/Web/HTTP/Methods). The relevant methods are all [HTTP methods](https://developer.mozilla.org/docs/Web/HTTP/Methods) except for TRACE, OPTIONS, HEAD, and GET.
286
286
* The request is associated with a valid endpoint.
287
287
@@ -302,7 +302,7 @@ Consider the following sample:
302
302
In the preceding code, posts to:
303
303
304
304
*`/todo` require a valid antiforgery token.
305
-
*`/todo2` do ***not*** require a valid antiforgery token because [`DisableAntiforgery`](https://source.dot.net/#Microsoft.AspNetCore.Routing/Builder/RoutingEndpointConventionBuilderExtensions.cs,022b9134f828d984) is called.
305
+
*`/todo2` do ***not*** require a valid antiforgery token because <xref:Microsoft.AspNetCore.Builder.RoutingEndpointConventionBuilderExtensions.DisableAntiforgery%2A> is called.
0 commit comments