Good days,
Lets say I have a static List<AClass>
object (lets name it myStaticList) which contains an other list inside and that list contains an other list with CId and Name property.
What I need to do is
foreach(AClass a in myStaticList)
{
foreach(BClass b in a.bList)
{
foreach(CClass c in b.cList)
{
if(c.CId == 12345)
{
c.Name = "Specific element in static list is now changed.";
}
}
}
}
Can I achieve this with LINQ Lambda expressions?
Something like;
myStaticList
.Where(a=>a.bList
.Where(b=>b.cList
.Where(c=>c.CId == 12345) != null) != null)
.something logical
.Name = "Specific element in static list is now changed.";
Please note that i want to change the property of that specific item in the static list.