I have an object that contains a string property, which returns a string that contains HTML tags:
[DataMember]
public string SomeProperty
{
return "<HTMLTag>";
}
When this object is serialized by DataContractJsonSerializer.WriteObject()
, the '<'
and '>'
characters are converted to "<"
and ">"
. Is there any attribute (or something else) that can prevent this from happening? I know WriteRaw
will do the trick, but I can't change the DataContractJsonSerializer.WriteObject()
is beyond my control. Thanks.