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;
     }
 }
Example #3
0
 public Nutrients(Nutrients nutrients)
 {
     if (nutrients != null)
     {
         Energy        = nutrients.Energy;
         Proteins      = nutrients.Proteins;
         Carbohydrates = nutrients.Carbohydrates;
         TotalFats     = nutrients.TotalFats;
         Diet          = nutrients.Diet;
     }
 }