Aracılığıyla paylaş


HttpJsonServiceExtensions.ConfigureHttpJsonOptions Yöntem

Tanım

ve Microsoft.AspNetCore.Http.HttpResponseJsonExtensions.WriteAsJsonAsynckullanırken Microsoft.AspNetCore.Http.HttpRequestJsonExtensions.ReadFromJsonAsync JSON okumak ve yazmak için kullanılan seçenekleri yapılandırılır. JsonOptions ,'den JsonSerializerDefaults.Webvarsayılan değerleri kullanır.

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

Parametreler

services
IServiceCollection

IServiceCollection yapılandırma seçenekleri açık.

configureOptions
Action<JsonOptions>

Action<T> öğesini yapılandırmak JsonOptionsiçin varsayılan değerlerini JsonSerializerDefaults.Webkullanır.

Döndürülenler

Değiştirilen IServiceCollection.

Şunlara uygulanır