I have the following code :
string messageString1 = JsonConvert.SerializeObject(thisComputer);
var data = new { deviceid = "info1", devicetype = "info2", data = messageString1};
My goal is to add messageString1 into data .
thisComputer
is a class and i know this part of the code works , because i got it working before , i'm just not being capable to get messageString1 into data.
I am not being able to insert data into data.I have tried several different ways but i still haven't figure it out.
EDIT: the problem is that i am trying to send the JSON to azure IoThub and in fact the contents are getting trough and into IoT Hub but all the double quotes characters are now '\"' and that constitutes the problem .
EXAMPLE: If the data inside is :
{"data":"dataInfo"}
in Iot Hub i see :
{\"data\":\datainfo\"}
Thanks in advance.