Class MvcBuilderExtensions
- Assembly
- Codebelt.Extensions.AspNetCore.Mvc.Formatters.Newtonsoft.Json.dll
Extension methods for the Microsoft.Extensions.DependencyInjection.IMvcBuilder interface.
public static class MvcBuilderExtensions
- Inheritance
-
MvcBuilderExtensions
Methods
AddNewtonsoftJsonFormatters(IMvcBuilder, Action<NewtonsoftJsonFormatterOptions>)
Adds the JSON serializer formatters to MVC.
public static IMvcBuilder AddNewtonsoftJsonFormatters(this IMvcBuilder builder, Action<NewtonsoftJsonFormatterOptions> setup = null)
Parameters
builder
IMvcBuilderThe Microsoft.Extensions.DependencyInjection.IMvcBuilder.
setup
Action<NewtonsoftJsonFormatterOptions>The NewtonsoftJsonFormatterOptions which may be configured.
Returns
- IMvcBuilder
A reference to
builder
after the operation has completed.
Exceptions
- ArgumentNullException
builder
cannot be null -or-setup
cannot be null.
AddNewtonsoftJsonFormattersOptions(IMvcBuilder, Action<NewtonsoftJsonFormatterOptions>)
Adds configuration of NewtonsoftJsonFormatterOptions for the application.
public static IMvcBuilder AddNewtonsoftJsonFormattersOptions(this IMvcBuilder builder, Action<NewtonsoftJsonFormatterOptions> setup = null)
Parameters
builder
IMvcBuilderThe Microsoft.Extensions.DependencyInjection.IMvcBuilder.
setup
Action<NewtonsoftJsonFormatterOptions>The NewtonsoftJsonFormatterOptions which need to be configured.
Returns
- IMvcBuilder
A reference to
builder
after the operation has completed.
Exceptions
- ArgumentNullException
builder
cannot be null.- ArgumentException
setup
failed to configure an instance of NewtonsoftJsonFormatterOptions in a valid state.