I am trying to mock some test data to verify that the json string is deserialized into the object correctly.
I have some json data with a length of 660 rows, so I only included a part
{ "DataA": "string", "DataB": "datetime", "DataC": { "DataC1": "datetime", "DataC2": "datetime", "DataC3": "datetime", "DataC4": int, "DataC5": int, "DataC6": "string", "DataC7": int, "DataC8": "object" }, "DataD": { "DataD1": decimal, "DataD2": decimal, "DataD3": "string", "DataD4": int, "DataD5": decimal, "DataD6": "string", "DataD7": { "DataD7i": null, "DataD7ii": [
I created the appropriate classes, but I'm currently trying to test them. However, I cannot get this json data into a string, since double quotes close the string. I also tried using ecsapes, but to no avail.
string testjson = "{ "DataA": "string", "DataB": "datetime", "DataC": { "DataC1": "datetime", "DataC2": "datetime", "DataC3": "datetime", "DataC4": int, "DataC5": int, "DataC6": "string", "DataC7": int, "DataC8": "object" }, "DataD": { "DataD1": decimal, "DataD2": decimal, "DataD3": "string", "DataD4": int, "DataD5": decimal, "DataD6": "string", "DataD7": { "DataD7i": null, "DataD7ii": ["
I want to call
ObjectA objectblah= JsonConvert.DeserializeObject<ObjectA>(output);
But cannot get json to string. I know this is a trivial problem, but I am new and stuck on this issue. Any help would be greatly appreciated.
thanks