Upload is just the class name.
You could use it without the class name.
class GroupUtil { public static List<Element> GetMembersRecursive(Document d, Group g, List<Element> r = null) { if (r == null) { r = new List<Element>(); } List<Element> elems = g.GetMemberIds().Select(q => d.GetElement(q)).ToList(); foreach (Element el in elems) { if (el.GetType() == typeof(Group)) { GetMembersRecursive(d, el as Group, r); continue; } r.Add(el); } return r; } }