I have a class, that has an object:
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34283")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
public partial class Scores : baseModel
{
private System.Xml.XmlAttribute[] anyAttrField;
/// <remarks/>
[System.Xml.Serialization.XmlAnyAttributeAttribute()]
public System.Xml.XmlAttribute[] AnyAttr
{
get
{
return this.anyAttrField;
}
set
{
this.anyAttrField = value;
}
}
}
From the parent class (snippet of it):
public parial class LandingPage : baseModel
{
private string projectNameField;
private Scores scoresField;
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string projectName
{
get { return this.projectNameField; }
set { this.projectNameField = value; }
}
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public Scores scores
{
get { return this.scoresField; }
set { this.scoresField = value }
}
}
The JSON string I'm trying to work with:
{
"projectName":"PROJECTTEST",
"scores":{
"browLocker":100,
"heavyAd":0,
"walletRedirection":0
}
}
NewtonSoft.JsonConvert ignores the scores child fields...
How can I easily convert this to work?