SaaS CMS has officially launched! Learn more now.

Class JsonFormatterOptionsExtensions

Convenient methods to configure JsonFormatterOptions

Inheritance
System.Object
JsonFormatterOptionsExtensions
Namespace: EPiServer.Formatters
Assembly: EPiServer.Cms.AspNetCore.dll
Version: 12.0.3
Syntax
public static class JsonFormatterOptionsExtensions : Object

Methods

UseNewtonsoftJson(JsonFormatterOptions, Assembly, String)

Registers Newtonsoft based IJsonInputFormatter and IJsonOutputFormatter for specified assembly

Declaration
public static JsonFormatterOptions UseNewtonsoftJson(this JsonFormatterOptions jsonFormatterOptions, Assembly assembly, string optionName = null)
Parameters
Type Name Description
JsonFormatterOptions jsonFormatterOptions

The options to configure

System.Reflection.Assembly assembly

The assembly to register formatter for

System.String optionName

An optional name for NewtonsoftJsonSerializerSettingsOptions

Returns
Type Description
JsonFormatterOptions

Option for further configuration

UseNewtonsoftJsonInputFormatter(JsonFormatterOptions, Assembly, String)

Registers Newtonsoft based IJsonInputFormatter for specified assembly

Declaration
public static JsonFormatterOptions UseNewtonsoftJsonInputFormatter(this JsonFormatterOptions jsonFormatterOptions, Assembly assembly, string optionName = null)
Parameters
Type Name Description
JsonFormatterOptions jsonFormatterOptions

The options to configure

System.Reflection.Assembly assembly

The assembly to register formatter for

System.String optionName

An optional name for NewtonsoftJsonSerializerSettingsOptions

Returns
Type Description
JsonFormatterOptions

Option for further configuration

UseNewtonsoftJsonOutputFormatter(JsonFormatterOptions, Assembly, String)

Registers Newtonsoft based IJsonOutputFormatter for specified assembly

Declaration
public static JsonFormatterOptions UseNewtonsoftJsonOutputFormatter(this JsonFormatterOptions jsonFormatterOptions, Assembly assembly, string optionName = null)
Parameters
Type Name Description
JsonFormatterOptions jsonFormatterOptions

The options to configure

System.Reflection.Assembly assembly

The assembly to register formatter for

System.String optionName

An optional name for NewtonsoftJsonSerializerSettingsOptions

Returns
Type Description
JsonFormatterOptions

Option for further configuration

UseSystemTextJson(JsonFormatterOptions, Assembly, String)

Registers System.Text.Json based IJsonInputFormatter and IJsonOutputFormatter for specified assembly

Declaration
public static JsonFormatterOptions UseSystemTextJson(this JsonFormatterOptions jsonFormatterOptions, Assembly assembly, string optionName = null)
Parameters
Type Name Description
JsonFormatterOptions jsonFormatterOptions

The options to configure

System.Reflection.Assembly assembly

The assembly to register formatter for

System.String optionName

An optional name for SystemTextJsonSettingsOptions

Returns
Type Description
JsonFormatterOptions

Option for further configuration

UseSystemTextJsonInputFormatter(JsonFormatterOptions, Assembly, String)

Registers System.Text.Json based IJsonInputFormatter for specified assembly

Declaration
public static JsonFormatterOptions UseSystemTextJsonInputFormatter(this JsonFormatterOptions jsonFormatterOptions, Assembly assembly, string optionName = null)
Parameters
Type Name Description
JsonFormatterOptions jsonFormatterOptions

The options to configure

System.Reflection.Assembly assembly

The assembly to register formatter for

System.String optionName

An optional name for SystemTextJsonSettingsOptions

Returns
Type Description
JsonFormatterOptions

Option for further configuration

UseSystemTextJsonOutputFormatter(JsonFormatterOptions, Assembly, String)

Registers System.Text.Json based IJsonOutputFormatter for specified assembly

Declaration
public static JsonFormatterOptions UseSystemTextJsonOutputFormatter(this JsonFormatterOptions jsonFormatterOptions, Assembly assembly, string optionName = null)
Parameters
Type Name Description
JsonFormatterOptions jsonFormatterOptions

The options to configure

System.Reflection.Assembly assembly

The assembly to register formatter for

System.String optionName

An optional name for SystemTextJsonSettingsOptions

Returns
Type Description
JsonFormatterOptions

Option for further configuration