Wednesday, October 19, 2011

an apology

this post should have shown this

foreach (Program program in programs) foreach (ProgramPlan programPlan in program.ProgramPlans) programPlans.Add(programPlan);

 
 

refactored to this

programPlans.AddRange(programs.SelectMany(program => program.ProgramPlans));

 
 

it's a good thing I practice TDD

No comments:

Post a Comment