protected IEnumerable<GenderNutrientRecommendation> GetGenderNutrientRecommendations(NutrientRecommendation nutrientRecommendation) { var manNutrientRecommendations = new GenderNutrientRecommendation { GenderType = man, NutrientRecommendation = nutrientRecommendation, }; manNutrientRecommendations.GenderAgeRecommendations = GetAgeRecommendations(ManRecommendations, manNutrientRecommendations); var womanNutrientRecommendations = new GenderNutrientRecommendation { GenderType = woman, NutrientRecommendation = nutrientRecommendation }; womanNutrientRecommendations.GenderAgeRecommendations = GetAgeRecommendations(WomanRecommendations, womanNutrientRecommendations); return new List<GenderNutrientRecommendation> { manNutrientRecommendations, womanNutrientRecommendations }; }
private IEnumerable<GenderAgeNutrientRecommendation> GetAgeRecommendations(IEnumerable<GenderAgeNutrientRecommendation> ageNutrientRecommendations, GenderNutrientRecommendation genderNutrientRecommendation) { foreach (var recommendation in ageNutrientRecommendations) { recommendation.GenderNutrientRecommendation = genderNutrientRecommendation; } return ageNutrientRecommendations; }