I have the following text:
Hello <b>User</p>
I am storing it as JSOn string in the database so as to use it later to deserialize it. Below is the JSON string sent to DB in MyProperty column:
{"Html":"Hello <b>User</p>"}
In order to deserialize that string back to my object I am using NewtonSoft.JSON dll.
JsonConvert.DeserializeObject<MyClass>(this.MyProperty);
When I deserialize it I am unable to get "Hello <b>User</p>" value back, it comes as null.
Note: If I am not string HTML in the JSON string it is returned back while deserializing.
Is there any limitation with html tags in JSON string?
My goal is store html tags in JSON string and get it back.
Edit:
Code of MyClass:
public class MyClass
{
public string Html { get; set; }
public string MyProperty { get; set; }
}
MyClasslooks like?