Issue I am trying to convert a JSON string to XML string in my excel macro, and I found out that Newtonsoft’s json .net library has a DeserializeXmlNode method in JsonConvert (https://www.newtonsoft.com/json/help/html/convertingjsonandxml.htm) which I think would help me convert a
Continue readingTag: json.net
[SOLVED] How to convert JSON to XML or XML to JSON?
Issue I started to use Json.NET to convert a string in JSON format to object or viceversa. I am not sure in the Json.NET framework, is it possible to convert a string in JSON to XML format and viceversa? Solution
Continue reading[SOLVED] Deserialize json into array when object name is an integer
Issue Firstly, I know how to deserialize json into objects in general but I am still very new to C#. I am able to deserialize the json below, but the outcome is not what I would call "elegant". { "slot":0,
Continue reading[SOLVED] How to convert json value to lowercase – Deserialization
Issue Please need some help. I am trying to convert all json value (not the key) to lowercase. I browsed and found only how to convert property name (key), not property value. I spent the whole day trying to figure
Continue reading[SOLVED] Add JObject to JObject
Issue I have a json structure like this: var json = { “report”: {}, “expense”: {}, “invoices”: {}, “projects”: {}, “clients”: {}, “settings”: { “users”: {}, “companies”: {}, “templates”: {}, “translations”: {}, “license”: {}, “backups”: {}, } } I would
Continue reading[SOLVED] How to Save Large Json Data?
Issue i have a large ObservableCollection that I want to get out as Json file. I used the following code, But I get an error out of memory string json = JsonConvert.SerializeObject(content, Formatting.Indented); await File.WriteAllTextAsync("file.json"); How can I save this
Continue reading[SOLVED] Newtonsoft json access array inside json
Issue I have a json file like this: { "foo": "bar", "1": 0, "array": [ "foo", "bar" ] } and I can access "foo" and "1" like this: using Newtonsoft.Json JObject o = JObject.Parse(json) Console.WriteLine((string)o["foo"]) // prints "bar" Console.WriteLine((int)o["1"]) //
Continue reading[SOLVED] Json deserialization with member names with leading or trailing spaces
Issue Is it possible to deserialize a Json string to an object if Json string has member names with leading/trailing white spaces. I am using Newtonsoft.Json as my serialization library. For example following is my object type: public class Sample
Continue reading[SOLVED] How do I skip default JavaScript array serialization for IEnumerable types in Json.Net?
Issue Some custom types that implement IEnumerable don’t necessarily have backing collections. They could be generated dynamically, for example using ‘yield’ or LINQ. Here is an example: public class SOJsonExample { public class MyCustomEnumerable : IEnumerable<KeyValuePair<int,float>> { public List<int> Keys
Continue reading[SOLVED] C# Get JSON Keys from Array without Model
Issue I have a JSON file { "RandonName": [ { "RandomKey1": "Data", "RandomKey2": "Data", "RandomKey3": "Data", "RandomKey4": "Data", "RandomKey5": "Data" }, { "RandomKey1": "Data", "RandomKey2": "Data", "RandomKey3": "Data", "RandomKey4": "Data", "RandomKey5": "Data" } ] } My Deserializer JsonTextReader JTR =
Continue reading