Esempio n. 1
0
        private void StoreFoodIngredientsWithoutAllergens(List <Food> food)
        {
            var ingredientsThatDontContainGivenAllergen = food
                                                          .SelectMany(p => p.Ingredients)
                                                          .GroupBy(p => p)
                                                          .Select(p => p.Key)
                                                          .Where(p => !IngredientsWithAllergens.Contains(p))
                                                          .ToList();

            IngredientsWithoutAllergens.AddRange(ingredientsThatDontContainGivenAllergen);
        }
Esempio n. 2
0
 private void StoreSuspiciousIngredients()
 {
     IngredientsWithAllergens.AddRange(_ingredientsThatMayContainAllergen);
     IngredientsWithAllergens = IngredientsWithAllergens.Distinct().ToList();
 }
Esempio n. 3
0
 private void RefreshIngredientsWithoutAllergens()
 {
     IngredientsWithoutAllergens = IngredientsWithoutAllergens.Distinct().ToList();
     IngredientsWithoutAllergens.RemoveAll(i => IngredientsWithAllergens.Contains(i));
 }