Open vikasNew opened 4 years ago
The @
in your code is being interpreted as a verbatim identifier indicator.
The best way to bind is likely to tag it with [JsonProperty("@timestamp")]
(though the verbatim literal mechanism will also let you name it that way via something like: public DateTime @"@timestamp" {get;set;}
)
That's right, and this should only happen in c# since we use [...] as a verbatim identifier indicator in vbnet like:
Public [Next] As Dictionary(Of List(Of String), String)
It's not the question on Json.net, but by design in c#.
@dovisutu int F#, you put double ticks around verbatim identifiers. e.g.
let [<Fact>] ``This is a test method`` () = Assert.Equal(1,1)
@vikasNew Can you close this please? (unless you have an open problem)
Hello,
i am facing a strange issue in Deserializing the json string to Model.
i hava a josn string which has some fields like "@timestamp". They has @ prefix.
when i deserialize them with "JsonConvert.DeserializeObject" then i could not get the json field value to my model. This is the issue with only fields which has @ prefix.
Source Code to Deserialize
Model
Output
01/01/0001 00:00:00
Then how to get the right @timestamp value in model ?
Thanks in anticipation !!