How do I do this in linq?
var p = new pmaker(); foreach (var item in itemlist) { var dlist = new List<Dummy>(); foreach (var example in item.examples) { dlist.Add(example.GetDummy()); } p.AddStuff(item.X,item.Y,dlist); } // .. do stuff with p
How about:
Not sure it is much clearer like this, though… personally I think I might just use the original
foreachversion… maybe splitting out theGetDummybit: