i have a type
class Foo
{
public string Name { get; set; }
}
and i can serialize it quickly with JsonConvert.SerializeObject() method (without custom settings). But if i decorate class definition with [DataContract] property Name is not serialized.
Is there a way to serialize DataContract Foo type WITHOUT decorating it with additional Newtonsoft.Json specific attributes?
Try annotating the property with the DataMember Attribute: