Skip to content
Documentation

MvcOptionsExtensions Class

Extension methods for adding error-handling features to an application using Microsofts MVC framework.

public static class MvcOptionsExtensions

Inheritance System.Object 🡒 MvcOptionsExtensions

MvcOptionsExtensions.AddProblemDetailsFormatter(this MvcOptions) Method

Section titled “MvcOptionsExtensions.AddProblemDetailsFormatter(this MvcOptions) Method”

Adds RFC7807 compliant formatting of errors to the application.

public static Microsoft.AspNetCore.Mvc.MvcOptions AddProblemDetailsFormatter(this Microsoft.AspNetCore.Mvc.MvcOptions mvcOptions);

mvcOptions Microsoft.AspNetCore.Mvc.MvcOptions

The Microsoft.AspNetCore.Mvc.MvcOptions of the application to add error output to.

Microsoft.AspNetCore.Mvc.MvcOptions
The mvcOptions themselves for chaining additional configuration.

Adds a Microsoft.AspNetCore.Mvc.Formatters.IOutputFormatter that can produce RFC7807 compliant application/problem+json responses from intances of

This should be added after all other custom output formatters have been added to the Microsoft.AspNetCore.Mvc.MvcOptions.OutputFormatters collection, otherwise it may have no effect.

MvcOptionsExtensions.AddSuccessResultFormatter(this MvcOptions) Method

Section titled “MvcOptionsExtensions.AddSuccessResultFormatter(this MvcOptions) Method”

Adds implicit Result to Success/Success<TValue> conversion to the application.

public static Microsoft.AspNetCore.Mvc.MvcOptions AddSuccessResultFormatter(this Microsoft.AspNetCore.Mvc.MvcOptions mvcOptions);

mvcOptions Microsoft.AspNetCore.Mvc.MvcOptions

The Microsoft.AspNetCore.Mvc.MvcOptions of the application to add success conversion to.

Microsoft.AspNetCore.Mvc.MvcOptions
The mvcOptions themselves for chaining additional configuration.

Adds a Microsoft.AspNetCore.Mvc.Formatters.IOutputFormatter that can convert into values as application/json responses from intances of

This should be added after all other custom output formatters have been added to the Microsoft.AspNetCore.Mvc.MvcOptions.OutputFormatters collection, otherwise it may have no effect.

MvcOptionsExtensions.ReturnBadRequestOnExtraneousQueryParameters(this MvcOptions) Method

Section titled “MvcOptionsExtensions.ReturnBadRequestOnExtraneousQueryParameters(this MvcOptions) Method”

Adds a filter to the request pipeline that makes checks if the client passed any query parameters not supported by the endpoint. If so, it short-circuits the rest of the request and responds with a 400 (Bad Request) response.

public static Microsoft.AspNetCore.Mvc.MvcOptions ReturnBadRequestOnExtraneousQueryParameters(this Microsoft.AspNetCore.Mvc.MvcOptions mvcOptions);

mvcOptions Microsoft.AspNetCore.Mvc.MvcOptions

The Microsoft.AspNetCore.Mvc.MvcOptions used to configure the application.

Microsoft.AspNetCore.Mvc.MvcOptions
The mvcOptions themselves for chaining additional configuration.

© 2026 Volue.Version v0.6.38017 November 2026