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

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -