일부 특성이있는 개체 목록을 얻었고이 목록을 채운 후에이 개체의 특정 변수에서 모든 요소를 가져 와서 새로운 INT 목록에 넣기를 원합니다. 예를 들어 보겠습니다 :개체 목록에서 모든 요소 가져 오기
public class Obj1
{
public int id {get; set; }
public string name {get; set; }
public int? age {get; set; }
}
public List<int> GetAgeList(List<Obj1> list)
{
List<int> ageList = list.age;//The idea is add all ages into the list..
return ageList;
}
고마워요!
이것은 간단한 질문입니다. 바로 답을하면 ... 궁금한 점이 있습니다. 무엇을 해결하려고합니까? – Coeffect