Пример #1
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);
        }
Пример #2
0
        public static PlanMealSaveModel Convert(PlanMealViewModel meal)
        {
            var n = new PlanMealSaveModel()
            {
                Name = meal.Name,
                Hour = meal.Hour,
                Min  = meal.Min
            };

            foreach (PlanConsumableViewModel item in meal.Consumables)
            {
                n.Items.Add(PlanItemSaveModel.Convert(item));
            }
            return(n);
        }