sreenivasa k

sreenivasa k

  • 890
  • 893
  • 34.2k

DeSerialization for circular reference entities

Jul 2 2017 11:14 AM
i have an xml and want to deserialize object. below is the xml
 
<school>
<students>
<stundent>
<name>James</name>
<student>
<name>Jason</name>
<student>
<name>Daniel</name>
</student>
</student>
</student>
</students>
</school>
 
Entity design:
 
[CollectionDataContract]
public class school
{
[XmlElement]
[DataMember]
public students students{get;set;}
}
[DataContract]
[Serializable]
[XmlType(TypeName="students")]
public class stundents{
[XmlElement]
[DataMember]
public student student{get;set;}
}
[DataContract]
[Serializable]
[XmlType(TypeName="student")]
public class student
{
public string name{get;set;}
}
 
 
I have used IsReference=true but did not get the expected result.  
 
 
 

Answers (1)