public NutrientsFoodViewModel(NutrientsFoodViewModel model) { if (model != null) { Nutrients = new Nutrients(model.Nutrients); Options = new FoodOptions(model.Options); FoodList = model.FoodList.Select(x => new Food(x)).ToList(); } }
public UserNutrientsFoodViewModel(UserNutrientsFoodViewModel model) { if (model != null) { UserProfile = new UserProfile(model.UserProfile); Nutrients = new Nutrients(model.Nutrients); Options = new FoodOptions(model.Options); FoodList = model.FoodList.Select(x => new Food(x)).ToList(); //UseCalcNutrients = model.UseCalcNutrients; } }
public FoodOptions(FoodOptions options) { if (options != null) { IsVegan = options.IsVegan; IsVegetarian = options.IsVegetarian; IsHalal = options.IsHalal; ContainsBeef = options.ContainsBeef; IsAlcohol = options.IsAlcohol; } }