Compartilhar via


HttpJsonServiceExtensions.ConfigureHttpJsonOptions Método

Definição

Configura as opções usadas para ler e gravar JSON ao usar Microsoft.AspNetCore.Http.HttpRequestJsonExtensions.ReadFromJsonAsync e Microsoft.AspNetCore.Http.HttpResponseJsonExtensions.WriteAsJsonAsync. JsonOptions usa valores padrão 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

O IServiceCollection no qual configurar as opções.

configureOptions
Action<JsonOptions>

O Action<T> para configurar o JsonOptions, usa valores padrão de JsonSerializerDefaults.Web.

Retornos

O IServiceCollection modificado.

Aplica-se a