MvcOptionsExtensions Class
HAKOM.Serialization.Http.Net.Api.Extensions
Section titled “HAKOM.Serialization.Http.Net.Api.Extensions”Allows using HAKOM formatters with the Microsoft.AspNetCore.Mvc framework.
public static class MvcOptionsExtensionsInheritance System.Object 🡒 MvcOptionsExtensions
Remarks
Section titled “Remarks”Usage:
Methods
Section titled “Methods”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);Parameters
Section titled “Parameters”mvcOptions Microsoft.AspNetCore.Mvc.MvcOptions
The Microsoft.AspNetCore.Mvc.MvcOptions to configure.
Returns
Section titled “Returns”Microsoft.AspNetCore.Mvc.MvcOptions
The given mvcOptions for chaining additional setup.
Exceptions
Section titled “Exceptions”System.ArgumentNullException
Thrown if mvcOptions is null.
Remarks
Section titled “Remarks”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);Parameters
Section titled “Parameters”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.
Returns
Section titled “Returns”Microsoft.AspNetCore.Mvc.MvcOptions
The modified mvcOptions for chaining.
Exceptions
Section titled “Exceptions”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);Parameters
Section titled “Parameters”mvcOptions Microsoft.AspNetCore.Mvc.MvcOptions
The Microsoft.AspNetCore.Mvc.MvcOptions to configure.
Returns
Section titled “Returns”Microsoft.AspNetCore.Mvc.MvcOptions
The mvcOptions for chaining additional configuration calls.
Exceptions
Section titled “Exceptions”System.ArgumentNullException
Thrown if mvcOptions is null.