Skip to content
Documentation

MvcOptionsExtensions Class

Allows using HAKOM formatters with the Microsoft.AspNetCore.Mvc framework.

public static class MvcOptionsExtensions

Inheritance System.Object 🡒 MvcOptionsExtensions

Usage:

MvcOptionsExtensions.AddDecodedRouteBinders(this MvcOptions) Method

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

Registers a custom Microsoft.AspNetCore.Mvc.ModelBinding.IValueProviderFactory for route values that reads from Microsoft.AspNetCore.Http.Features.IHttpRequestFeature.RawTarget and applies System.Uri.UnescapeDataString(System.String) exactly once.

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

mvcOptions Microsoft.AspNetCore.Mvc.MvcOptions

The Microsoft.AspNetCore.Mvc.MvcOptions to configure.

Microsoft.AspNetCore.Mvc.MvcOptions
The given mvcOptions for chaining additional setup.

System.ArgumentNullException
Thrown if mvcOptions is null.

After calling this method any [FromRoute]-bound parameter, regardless of type, receives a value that has been percent-decoded exactly once before reaching the action.

MvcOptionsExtensions.AddHakomFormatters(this MvcOptions, bool) Method

Section titled “MvcOptionsExtensions.AddHakomFormatters(this MvcOptions, bool) Method”

Adds HAKOM input and output formatters to the given mvcOptions.

public static Microsoft.AspNetCore.Mvc.MvcOptions AddHakomFormatters(this Microsoft.AspNetCore.Mvc.MvcOptions mvcOptions, bool clearExistingFormatters=true);

mvcOptions Microsoft.AspNetCore.Mvc.MvcOptions

The Microsoft.AspNetCore.Mvc.MvcOptions to add the formatters to.

clearExistingFormatters System.Boolean

Whether or not to clear previously added Input/OutputFormatters.

Microsoft.AspNetCore.Mvc.MvcOptions
The modified mvcOptions for chaining.

System.ArgumentNullException
Thrown if mvcOptions is null.

MvcOptionsExtensions.AddHakomModelBinders(this MvcOptions) Method

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

Adds the ability to use ICustomModelBinder implementations with the MVC framework.

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

mvcOptions Microsoft.AspNetCore.Mvc.MvcOptions

The Microsoft.AspNetCore.Mvc.MvcOptions to configure.

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

System.ArgumentNullException
Thrown if mvcOptions is null.

© 2026 Volue.Version v0.6.38017 November 2026