I am trying to mock up some test data to check wether a json string deserializes into an object correctly.
I have some json data which is 660 lines long, so i have only included a portion
{
"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 have created the corresponding classes, but am currently attempting to test them. However I am unable to get this json data into a string, as the double quotation marks close off the string. I have tried using ecsapes aswell 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 manage to get the json into a string. I am aware this is a trivial issue, but I am new and am stuck on this issue. any help would be greatly appreciated.
Thanks