日期:2014-05-20 浏览次数:21022 次
Class Parent
{
List<Son> _SonList =new List<Son>();
public List<Son> SonList
{
get;
}
}
Class Son
{
Parent _Parent;
public Parent
{
get;
set;
}
string _Data;
public String Data
{
get;set;
}
public Son(Parent p, string data)
{
_Parent =p;
_Data=data;
_Parent.SonList.add(this);
}
}
------解决方案--------------------
public Child_A{}
public Child_B{}
public Parent{
public Collection<Child_A> Child_As {get;set;}
public Collection<Child_B> Child_Bs{get;set;}
}