JSON.Net – Change $type field to another name?

http://json.codeplex.com/workitem/22429 “I would rather keep $type hard coded and consistent.” Consistent with what I wonder? http://json.codeplex.com/workitem/21989 I would rather not – I think this is too specific to me and I don’t want to go overboard with settings. At some point I will probably implement this – http://json.codeplex.com/workitem/21856 – allowing people to read/write there own … Read more

What is the existingValue parameter used for in the ReadJson method of a JsonConverter?

Simply put, the existingValue parameter gives you the existing or default value of the object that will ultimately be replaced with the value returned from the ReadJson method. This gives the ReadJson method the chance to evaluate the existing value when determining what to return. The method could, for example, decide to keep the default, … Read more

JSON.Net error reading

You could try using a JArray. This JSON data is actually an array. JArray v = JArray.Parse(s); To get the first item. var firstItem = v[0][“UIDClan”].ToString(); You can even use linq var items = v.Where(x => x[“UIDClan”].ToString() == “1”).ToList();

Self referencing loop detected in ASP.NET Core [duplicate]

There is no difference in the way self-referencing loops are handled in ASP.NET 4 compared to ASP.NET Core (previously Asp.Net 5). The principles outlined in the question you referenced in your post still apply. However, setting this property in ASP.NET Core is obviously slightly different, given the new method of configuring and bootstrapping the app: … Read more

JSON.NET: Why Use JToken–ever?

From the standard, JSON is built out of the following five types of token: object: an unordered set of name/value pairs. array: an ordered collection of values. value: a string in double quotes, or a number, or true or false or null, or an object or an array. These structures can be nested. string number. … Read more

JSON.net ContractResolver vs. JsonConverter

Great question. I haven’t seen a clear piece of documentation that says when you should prefer to write a custom ContractResolver or a custom JsonConverter to solve a particular type of problem. They really do different things, but there is some overlap between what kinds of problems can be solved by each. I’ve written a … Read more

tech