title: Put the knife down and take a green herb, dude. |
descrip: One feller's views on the state of everyday computer science & its application (and now, OTHER STUFF) who isn't rich enough to shell out for www.myfreakinfirst-andlast-name.com Using 89% of the same design the blog had in 2001. |
FOR ENTERTAINMENT PURPOSES ONLY!!!
Back-up your data and, when you bike, always wear white. As an Amazon Associate, I earn from qualifying purchases. Affiliate links in green. |
|
Thursday, January 24, 2013 | |
Using JSONs Special Properties of $ref and $id | Jaress Loo: I had never seen this $ref and $id tags before, so I didn’t know how to use them or what to make of it. It turns out that in order to condense the JSON object into a smaller object, it avoids rewriting an object twice if it doesn’t have to. In order to accomplish this, the JSON.NET serializer will serialize these special JSON properties of $id and $ref. Every object being serialized will get an $id. If that same exact object is used again somewhere in the same JSON object, it will use a $ref property to tell you that the particular object you’re looking at has already been serialized. It then gives you the $id to lookup as the value of the $ref property so that you know where to find the object being referred to. Phew. Wondered what $id was for in Json.NET. You can blast that shorthand if you want. And wow, does this speed up getting info from a database to json. Between the Entity Framework objects and Json.NET, about all you need a programmer for is constructing the LINQ where clause. Labels: c#, json, noteToSelf posted by ruffin at 1/24/2013 08:02:00 PM |
|
| |
MarkUpDown is the best Markdown editor for professionals on Windows 10. It includes two-pane live preview, in-app uploads to imgur for image hosting, and MultiMarkdown table support. Features you won't find anywhere else include...
You've wasted more than $15 of your time looking for a great Markdown editor. Stop looking. MarkUpDown is the app you're looking for. Learn more or head over to the 'Store now! |
![]() |
|
|