Class CurrentCultureDecimalBinderProvider
Provider that uses the binder model responsible for handling the decimal format for the current culture.
Inheritance
System.Object
CurrentCultureDecimalBinderProvider
Namespace: StoneCo.Framework.Host.Api.Binders
Assembly: cs.temp.dll.dll
Syntax
public class CurrentCultureDecimalBinderProvider : IModelBinderProvider
Methods
GetBinder(ModelBinderProviderContext)
Method responsible for returning an instance of model binder to decimal numbering.
Declaration
public IModelBinder GetBinder(ModelBinderProviderContext context)
Parameters
Type | Name | Description |
---|---|---|
ModelBinderProviderContext | context | The ModelBinderProviderContext. |
Returns
Type | Description |
---|---|
IModelBinder | An IModelBinder. |
Examples
In the host layer into configuration folder, create a new file that's name MvcOptionsConfigurations.
Create a new method as below.
public static class MvcOptionsConfigurations
{
public static MvcOptions ConfigureModelBinders(this MvcOptions options)
{
options.ModelBinderProviders.Insert(1, new CurrentCultureDecimalBinderProvider());
return options;
}
}
note
Do not forget to number the binders so that one does not replace the other.