c# - Controller's action with dictionary as parameter stripping to dot -
i have action receives class dictionary in properties:
public actionresult testaction(testclass testclass) { return view(); } public class testclass { public dictionary<string, string> keyvalues { get; set; } }
if post action following json:
{ "keyvalues": { "test.withdot": "testwithdot" } }
the key in dictionary stripped dot , has nothing in value.
trying without dot works. how can post dot in dictionary<string, string>
mvc?
we gave blind try supposing there regex parser somewhere in deep (well minimal chance) , escape 'dot'.
after thinking while concluded: dot not legal char in identifiers. yes know key in c# dictionary, in json part (and javascript) in identifier syntax role.
so suggest replace client side .
(dot) escape sequence _dot_
, replace in server side. performance suffer of course.
Comments
Post a Comment