Пример #1
0
 public static PlanSaveModel Convert(PlanViewModel model)
 {
     return(new PlanSaveModel()
     {
         Days = model.Days.Select(x => PlanDaySaveModel.Convert(x)).ToList()
     });
 }
Пример #2
0
        public static PlanDaySaveModel Convert(PlanDayViewModel model)
        {
            var n = new PlanDaySaveModel()
            {
                DayName = model.DayName
            };

            foreach (PlanMealViewModel meal in model.Meals)
            {
                n.Meals.Add(PlanMealSaveModel.Convert(meal));
            }
            return(n);
        }