c# - foreach list<object> in object -
i want make foreach
each item in list. doesn't seem possible. or doing wrong?
the c# class group
public int _id; public string name; public list<subgroups> subs;
the c# class subgroup
public int _id; public string name;
normally this
// make group = groups foreach(var g in group) { foreach(var s in group.subs) { // } }
but can't call group.subs or @ least won't show. possible?
foreach(var g in group) { foreach(var s in g.subs) { // } }
you have use variable in outer loop; current variable in iteration.
Comments
Post a Comment