Class SystemTextJsonFormatterExtensions

Extends Microsoft.Extensions.DependencyInjection.IServiceCollection with convenience methods to register module formatters

Inheritance
System.Object
SystemTextJsonFormatterExtensions
Namespace: Microsoft.Extensions.DependencyInjection
Assembly: EPiServer.Cms.AspNetCore.dll
Version: 12.0.3
Syntax
public static class SystemTextJsonFormatterExtensions : Object

Methods

UseSystemTextJsonSerialization(IServiceCollection, IEnumerable<Type>, Action<JsonSerializerOptions>)

Registers System.Text based IJsonInputFormatter and IJsonOutputFormatter for specified types

Declaration
public static IServiceCollection UseSystemTextJsonSerialization(this IServiceCollection services, IEnumerable<Type> types, Action<JsonSerializerOptions> settings = null)
Parameters
Type Name Description
Microsoft.Extensions.DependencyInjection.IServiceCollection services
System.Collections.Generic.IEnumerable<System.Type> types
System.Action<System.Text.Json.JsonSerializerOptions> settings
Returns
Type Description
Microsoft.Extensions.DependencyInjection.IServiceCollection

UseSystemTextJsonSerialization(IServiceCollection, Assembly, Action<JsonSerializerOptions>)

Registers System.Text based IJsonInputFormatter and IJsonOutputFormatter for the assembly

Declaration
public static IServiceCollection UseSystemTextJsonSerialization(this IServiceCollection services, Assembly assembly, Action<JsonSerializerOptions> settings = null)
Parameters
Type Name Description
Microsoft.Extensions.DependencyInjection.IServiceCollection services
System.Reflection.Assembly assembly
System.Action<System.Text.Json.JsonSerializerOptions> settings
Returns
Type Description
Microsoft.Extensions.DependencyInjection.IServiceCollection

UseSystemTextJsonSerialization(IServiceCollection, Type, Action<JsonSerializerOptions>)

Registers newtonsoft IJsonInputFormatter and IJsonOutputFormatter for the type

Declaration
public static IServiceCollection UseSystemTextJsonSerialization(this IServiceCollection services, Type type, Action<JsonSerializerOptions> settings = null)
Parameters
Type Name Description
Microsoft.Extensions.DependencyInjection.IServiceCollection services
System.Type type
System.Action<System.Text.Json.JsonSerializerOptions> settings
Returns
Type Description
Microsoft.Extensions.DependencyInjection.IServiceCollection