Table of Contents

AddMinimalJsonOptions Method

Definition

Namespace
Cuemon.Extensions.AspNetCore.Text.Json
Assemblies
Cuemon.Extensions.AspNetCore.Text.Json.dll
Source
src/Cuemon.Extensions.AspNetCore.Text.Json/ServiceCollectionExtensions.cs

AddMinimalJsonOptions(IServiceCollection, Action<JsonFormatterOptions>)

Adds a JsonFormatterOptions service to the specified IServiceCollection.

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

Parameters

services IServiceCollection

The IServiceCollection to add services to.

setup Action<JsonFormatterOptions>

The JsonFormatterOptions which may be configured.

Returns

IServiceCollection

An IServiceCollection that can be used to further configure other services.

Remarks

This method registers a MinimalJsonOptions configuration as a singleton IConfigureOptions<TOptions> for JsonOptions and delegates to AddJsonExceptionResponseFormatter(IServiceCollection, Action<JsonFormatterOptions>) to configure the JSON exception response formatter.

Exceptions

ArgumentNullException

services cannot be null.