I am trying to send JSON to NancyFx. JSON:
{ "prop1": 1, "entries":{ "Entry1": 1, "entry2": 2 } }
On the server side, I created an appropriate model:
public class Model { public int Prop1 { get; set; } public IDictionary<string, object> Entries { get; set; } }
Field
entries in JSON has a dynamic structure, and because of this, the model uses IDictionary<string, object> .
And then I bind the model:
this.Bind<Model>();
The model was created successfully, but the problem is that in the entries dictionary both keys are in the capital case. For me, the matter is very important, and I expect that the second key will be e ntry2, not E ntry2.
I also tried using JavaScriptConverter and JavaScriptPrimitiveConverter , but in the Deserialize method I got the header data already.
Any ideas on how to fix this?
source share