public static Dictionary <string, FieldDescriptor <Tbase> > GetAllTypeInstancesBasedOn <Tbase>(Group instance) { var t = typeof(Tbase); var allFields = new Dictionary <string, FieldDescriptor <Tbase> >(); var Thost = instance.GetType(); foreach (var Fi in Thost .GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance) .Where(fi => t.IsAssignableFrom(fi.FieldType)).ToList()) { allFields.Add( Fi.Name, new FieldDescriptor <Tbase> { Value = (Tbase)Fi.GetValue(instance), Attributes = Fi.GetCustomAttributes(typeof(Attribute), true).Cast <Attribute>().ToList() } ); } t = typeof(List <Tbase>); foreach (var Fi in Thost .GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance) .Where(fi => fi.FieldType.IsList()).ToList()) { var tp = Fi.FieldType.GenericTypeArguments.First(); if (tp == typeof(Tbase)) { var it = Fi.GetValue(instance); var l = (List <Tbase>)Fi.GetValue(instance); var iterator = 0; if (l != null) { l.ForEach( i => allFields.Add( Fi.Name + "_" + iterator++, new FieldDescriptor <Tbase> { Value = i, Attributes = Fi.GetCustomAttributes(typeof(Attribute), true).Cast <Attribute>().ToList() } ) ); } } } return(allFields); }