가능한 중복 :
How to iterate the List in Reflection
Problem with IEnumerable in Reflection문제
안녕, 반사의 목록이 반복되는 동안이 문제에 직면하고있다
.
var item = property.GetValue(obj,null); // We dont know the type of obj as it is in Reflection.
foreach(var value in (item as IEnumerable))
{
//Do stuff
}
내가 이렇게하면 내가 제네릭 형식 'System.Collections.Generic.IEnumerable'를 사용
같은 오류가 하나 개의 형태 인수
제발 도와주세요을 요구 받게됩니다.
당신은 IEnumerable '에 캐스트 할 필요가 없습니다. IEnumerable – Stecya