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

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -