You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
Problem when getting a Dictionary<string, string> as all parameters passed to the controller in query string. I am using [FromQuery] for that case but when parameter got a dot sign (.) inside it's name it get parsed wrong. What is more I debugged it and inside Response.Query object it is handled properly so the problem probably is somewhere in DictionaryModelBinderProvider. Below screenshot to the debugged code:
The . character is indeed a special character that denotes a sub-property (just like in C#). The other special characters are [ and ], which denote indexers (also, just like in C#).
These patterns are fairly common in various binding systems. jQuery, PHP, and other frameworks follow similar patterns.
Problem when getting a Dictionary<string, string> as all parameters passed to the controller in query string. I am using
[FromQuery]
for that case but when parameter got a dot sign (.
) inside it's name it get parsed wrong. What is more I debugged it and insideResponse.Query
object it is handled properly so the problem probably is somewhere inDictionaryModelBinderProvider
. Below screenshot to the debugged code:Full query string sent to the controller:
?query=&InspectionType=Safety&ItemType=InspectionPoint&RecordParentGUID=9275bee2-0a2d-461c-8835-51880e76f035&parent.ResultClassCode=parent.ResultClassCode
Already opened a question on SO about that problem so will add also a link here: https://stackoverflow.com/questions/45997570/asp-net-core-fromquery-getting-invalid-parameters-with-dot-sign-inside
The text was updated successfully, but these errors were encountered: