foreach(Dog d in Dogs)
string name = d.Name;
int age = a.age;
foreach(Paw p in d.Paws)
int pawShape = p.Shape;
foreach(Toe t in p.Toes)
int toeStrength = t.Strength;
foreach (ToeNail n in t.ToeNails)
int nailRating = n.Rating;
string nailContext = n.Context;
I don't wish to use so many foreach loops. How can I extract the required data using LINQ?
I woul like to produce a list like so:
Name PawId PawShape ToeId TwoStrength NailId NailRating NailContext
Fred 123 3 2 3 3 5 solid
Spot 546 8 4 8 4 3 damaged
It would also be nice if I could put the data in a dictionary using the Name as the Key?