QueryStringValueProviderFactory calls QueryStringValueProvider's wrong constructor :
// For unit testing
internal QueryStringValueProvider(ControllerContext controllerContext, IUnvalidatedRequestValues unvalidatedValues)
: base(controllerContext.HttpContext.Request.QueryString, unvalidatedValues.QueryString, CultureInfo.InvariantCulture)
{
}
wich ignores the current culture.
The observed behavior is for example wrong DateTime parsing. Workarounds are to pass parameter with POST verb and so using a different ValueProvider or passing dateTime parameters as string and convert the values inside the controller.
Comments: Tested on MVC, and by just looking at webapi source code looks like the same problem : QueryStringValueProviderFactory:27 provider = new QueryStringValueProvider(actionContext, CultureInfo.InvariantCulture);
// For unit testing
internal QueryStringValueProvider(ControllerContext controllerContext, IUnvalidatedRequestValues unvalidatedValues)
: base(controllerContext.HttpContext.Request.QueryString, unvalidatedValues.QueryString, CultureInfo.InvariantCulture)
{
}
wich ignores the current culture.
The observed behavior is for example wrong DateTime parsing. Workarounds are to pass parameter with POST verb and so using a different ValueProvider or passing dateTime parameters as string and convert the values inside the controller.
Comments: Tested on MVC, and by just looking at webapi source code looks like the same problem : QueryStringValueProviderFactory:27 provider = new QueryStringValueProvider(actionContext, CultureInfo.InvariantCulture);