나는 다음과 같은 경우가 있습니다부모 자식 관계
public class ParentObject
{
public int id {get;set;}
public string parent_object_name {get;set;}
public List<ChildObject> child_objects {get;set;}
}
public class ChildObject
{
public int id {get;set;}
public string child_object_name {get;set;}
}
ParentObject parent_object = new ParentObject()
{
id = 1,
parent_object_name = "test name",
child_objects = new List<ChildObject>(){ new ChildObject(){ id = 1, child_object_name = "test name"};
}
나는 parent_object.child_objects
을 참조하기 위해 완벽하게 유효하다는 것을 알고,하지만 난 참조 등을 가지고 내 수업을 코딩 할 수있는 방법을 잘 모르겠습니다을 예 : child_objects.First().parent_object
Entity Framework의 탐색 속성과 비슷합니다.
@Fildor 편집을. – mko