Given an object possibly containing an IEnumerable, how would I check that an IEnumerable property exists, and if it does, loop o
IEnumerable
foreach (var property in yourObject.GetType().GetProperties()) { if (property.PropertyType.GetInterfaces().Contains(typeof(IEnumerable))) { foreach (var item in (IEnumerable)property.GetValue(yourObject, null)) { //do stuff } } }