Пример #1
0
 public GoalListDto(GoalList GoalList)
 {
     GoalListId = GoalList.GoalListId;
     UserId     = GoalList.UserId;
     Title      = GoalList.Title;
     Goals      = new List <GoalItemDto>();
     foreach (GoalItem item in GoalList.Goals)
     {
         Goals.Add(new GoalItemDto(item));
     }
 }
Пример #2
0
        public GoalList ToEntity()
        {
            GoalList Goal = new GoalList
            {
                Title       = Title,
                GoalListId  = GoalListId,
                UserId      = UserId,
                StartDate   = StartDate,
                EndDate     = EndDate,
                Description = Description,
                Category    = Category,
                Goals       = new List <GoalItem>()
            };

            foreach (GoalItemDto item in Goals)
            {
                Goal.Goals.Add(item.ToEntity());
            }

            return(Goal);
        }