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()); }
public static Ingredient FromDomainIngredient(Domain.Ingredients.Entities.Ingredient ingredient) => new Ingredient(ingredient.Id.Value, ingredient.Name, ingredient.Allergens.ToString(), ingredient.Requirements.ToString(), GetMacroNutrientShares(ingredient));