Compartir a través de


HttpJsonServiceExtensions.ConfigureHttpJsonOptions Método

Definición

Configura las opciones usadas para leer y escribir JSON cuando se usa Microsoft.AspNetCore.Http.HttpRequestJsonExtensions.ReadFromJsonAsync y Microsoft.AspNetCore.Http.HttpResponseJsonExtensions.WriteAsJsonAsync. JsonOptions usa valores predeterminados de JsonSerializerDefaults.Web.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection ConfigureHttpJsonOptions (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.AspNetCore.Http.Json.JsonOptions> configureOptions);
static member ConfigureHttpJsonOptions : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.AspNetCore.Http.Json.JsonOptions> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function ConfigureHttpJsonOptions (services As IServiceCollection, configureOptions As Action(Of JsonOptions)) As IServiceCollection

Parámetros

services
IServiceCollection

en el IServiceCollection que se van a configurar las opciones.

configureOptions
Action<JsonOptions>

Action<T> para configurar , JsonOptionsusa valores predeterminados de JsonSerializerDefaults.Web.

Devoluciones

IServiceCollection que se ha modificado.

Se aplica a