List<myClass>() myList= new List<myClass>();
myList.add(new myClass(){ ID=2,Name="2" });
JsonConvert.SerializeObject(myList);
output :
[{\"ID\":2,\"FullName\":\"2\"}]
How can I prevent backslash?
List<myClass>() myList= new List<myClass>();
myList.add(new myClass(){ ID=2,Name="2" });
JsonConvert.SerializeObject(myList);
output :
[{\"ID\":2,\"FullName\":\"2\"}]
How can I prevent backslash?
In C# when convert an object to json string, it is just a string. In VS studio double quotes must be escaped. So the result you received is correct. Other wise compiler will not be able to compile that string.
When you debug this you can see the string as you want in text preview.