Assign any IEnumerable to object property
问题 I have a list of objects created using reflection, they are all the same type, however the type is unknown at compile time. I'm trying to figure out the best way of assigning this list (also using reflection) to an object property which could be any IEnumerable. List<object> ArrayList Custom : List<object> The only approach I have is to assume the property is an ICollection then loop through the IEnumerable and add each item. (See below, where list is the IEnumerable source, key is the string