Condividi tramite


HttpJsonServiceExtensions.ConfigureHttpJsonOptions Metodo

Definizione

Configura le opzioni usate per la lettura e la scrittura di JSON quando si usa Microsoft.AspNetCore.Http.HttpRequestJsonExtensions.ReadFromJsonAsync e Microsoft.AspNetCore.Http.HttpResponseJsonExtensions.WriteAsJsonAsync. JsonOptions usa i valori predefiniti da 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

Parametri

services
IServiceCollection

Opzione IServiceCollection su cui configurare le opzioni.

configureOptions
Action<JsonOptions>

Per Action<T> configurare , JsonOptionsusa i valori predefiniti da JsonSerializerDefaults.Web.

Restituisce

Oggetto IServiceCollection modificato.

Si applica a