i have an object of the following definition
public class @class
{
public List<ClassHelperNavNode> obj {get; set;}
public int ID {get;set;}
public int ParentID {get;set;}
public string Title {get;set;}
public @class()
{
obj = new List<ClassHelperNavNode>();
}
}
public class ClassHelperNavNode
{
public List<ClassHelperNavNode> obj {get; set;}
public int ID {get;set;}
public int ParentID {get;set;}
public string Title {get;set;}
public string Narrative {get;set;}
public ClassHelperNavNode()
{
obj = new List<ClassHelperNavNode>();
}
}
Assume there is an object from class @class
c1
. How do i convert this complex object to anonymous object?
Note: I have updated my post with relevant contructors
here are some pic to show the receving object
I need to return an anonymous object using the values in the class (including the nested collections), but rename the property names from
ID
toid
ParentID
toparent
Title
totext
Narrative
tovalue