|
2 | 2 | // The .NET Foundation licenses this file to you under the MIT license.
|
3 | 3 |
|
4 | 4 | using Microsoft.AspNetCore.Http.Json;
|
5 |
| -using Microsoft.Extensions.DependencyInjection; |
6 | 5 |
|
7 |
| -namespace Microsoft.AspNetCore.Http; |
| 6 | +namespace Microsoft.Extensions.DependencyInjection; |
8 | 7 |
|
9 | 8 | /// <summary>
|
10 | 9 | /// Extension methods to configure JSON serialization behavior.
|
11 | 10 | /// </summary>
|
12 |
| -public static class HttpJsonServiceExtensions |
| 11 | +public static class RouteHandlerJsonServiceExtensions |
13 | 12 | {
|
| 13 | +#pragma warning disable CS0419 // Ambiguous reference in cref attribute |
14 | 14 | /// <summary>
|
15 | 15 | /// Configures options used for reading and writing JSON by route handlers.
|
16 | 16 | /// </summary>
|
17 | 17 | /// <remarks>
|
18 | 18 | /// The options configured here will only affect JSON returned and processed
|
19 |
| - /// from route handlers, not controllers. |
| 19 | + /// from route handlers, not controllers, when using <see cref="System.Net.Http.Json.HttpContentJsonExtensions.ReadFromJsonAsync" /> |
| 20 | + /// and <see cref="Microsoft.AspNetCore.Http.HttpResponseJsonExtensions.WriteAsJsonAsync" />. |
20 | 21 | /// </remarks>
|
21 | 22 | /// <param name="services">The <see cref="IServiceCollection" /> to configure options on.</param>
|
22 | 23 | /// <param name="configureOptions">The <see cref="Action{JsonOptions}"/> to configure the
|
23 | 24 | /// <see cref="JsonOptions"/>.</param>
|
24 | 25 | /// <returns>The modified <see cref="IServiceCollection"/>.</returns>
|
25 |
| - public static IServiceCollection ConfigureHttpJsonOptions(this IServiceCollection services, Action<JsonOptions> configureOptions) |
| 26 | +#pragma warning restore CS0419 // Ambiguous reference in cref attribute |
| 27 | + public static IServiceCollection ConfigureRouteHandlerJsonOptions(this IServiceCollection services, Action<JsonOptions> configureOptions) |
26 | 28 | {
|
27 | 29 | services.Configure<JsonOptions>(configureOptions);
|
28 | 30 | return services;
|
|
0 commit comments