AddNewtonsoftJsonFormatterOptions Method
Definition
- Namespace
- Codebelt.Extensions.AspNetCore.Newtonsoft.Json.Formatters
- Assemblies
- Codebelt.Extensions.AspNetCore.Newtonsoft.Json.dll
AddNewtonsoftJsonFormatterOptions(IServiceCollection, Action<NewtonsoftJsonFormatterOptions>)
Adds configuration of NewtonsoftJsonFormatterOptions for the application.
public static IServiceCollection AddNewtonsoftJsonFormatterOptions(this IServiceCollection services, Action<NewtonsoftJsonFormatterOptions> setup = null)
Parameters
servicesIServiceCollectionThe IServiceCollection to extend.
setupAction<NewtonsoftJsonFormatterOptions>The NewtonsoftJsonFormatterOptions which may be configured.
Returns
- IServiceCollection
A reference to
servicesso that additional configuration calls can be chained.
Exceptions
- ArgumentNullException
servicescannot be null.- ArgumentException
setupfailed to configure an instance of NewtonsoftJsonFormatterOptions in a valid state.