I am trying to make Handlebars to parse my templates with case-insensitive properties.
By default this works fine when using dynamics:
var data = new{
name = "firstname",
Lastname = "LastName"
};
Handlebars.Compile("Name: {{Name}} {{LastName}}").Invoke(data)
Result : Name: firstname LastName
But when I use Json as input data the properties seem to be case sensitive:
var data = JsonConvert.DeserializeObject<ExpandoObject>("{name:\"firstname\",Lastname:\"LastName\"}");
Handlebars.Compile("Name: {{Name}} {{LastName}}").Invoke(data);
Result:Name:
I have also tested it with:
JsonConvert.DeserializeObject< ExpandoObject>()
JsonConvert.DeserializeObject< dynamic>
How can i get get the same results as C# dynamics with JSON data?
I am trying to make Handlebars to parse my templates with case-insensitive properties.
By default this works fine when using dynamics:
Result : Name: firstname LastName
But when I use Json as input data the properties seem to be case sensitive:
Result:Name:
I have also tested it with:
How can i get get the same results as C# dynamics with JSON data?
Update note: fixed code blocks