Exemplo n.º 1
0
        private static ICollection <MacroNutrientShares> GetMacroNutrientShares(Domain.Ingredients.Entities.Ingredient ingredient)
        {
            var sharesCollection = ingredient.MacroNutrientsSharesCollection;

            return(sharesCollection.Select(x => MacroNutrientShares.FromDomainIngredient(ingredient.Id.Value, x))
                   .ToList());
        }
Exemplo n.º 2
0
 public static Ingredient FromDomainIngredient(Domain.Ingredients.Entities.Ingredient ingredient) =>
 new Ingredient(ingredient.Id.Value,
                ingredient.Name,
                ingredient.Allergens.ToString(),
                ingredient.Requirements.ToString(),
                GetMacroNutrientShares(ingredient));