Table of Contents

AddJsonFormatterOptions Method

Definition

AddJsonFormatterOptions(IServiceCollection, Action<JsonFormatterOptions>)

Adds configuration of JsonFormatterOptions for the application.

public static IServiceCollection AddJsonFormatterOptions(this IServiceCollection services, Action<JsonFormatterOptions> setup = null)

Parameters

services IServiceCollection

The IServiceCollection to extend.

setup Action<JsonFormatterOptions>

The JsonFormatterOptions which may be configured.

Returns

IServiceCollection

A reference to services so that additional configuration calls can be chained.

Exceptions

ArgumentNullException

services cannot be null.

ArgumentException

setup failed to configure an instance of JsonFormatterOptions in a valid state.