를 null로 나열하려면 다음객체 [] 내가처럼 보이는 물체가있는 경우 <Interface> 반환
class Person : IProxy
{
// Properties
}
을 그리고 실제로 List<Person>
인 object
반환하는 방법이 있습니다
object GetList()
{
List<Person> people = new List<Person>();
person.Add(new Person());
person.Add(new Person());
return people;
}
왜 다음 코드 결과가 null입니까?
object {System.Collections.Generic.List<Person>}
앞에'목록을의''목록 는'에 관계없이 IProxy에 사람의 관계 _not_입니다 . stackoverflow (역행렬과 공분산)에 관한 이것에 관한 질문의 힙이 있습니다. 간단히 말해 다음과 같이 할 수 있습니다 :'GetList() as List) .Cast ();' –
Rob