示例#1
0
        public static Task GetByID(int ID)
        {
            var repository = new TaskRepository();

            var taskDTO = repository.FetchByID(ID);

            var task = CreateTaskFromDTO(taskDTO);

            task.Comments = CommentCollection.GetByTaskID(task.ID);

            task.MarkOld();

            return(task);
        }
示例#2
0
        public static CommentCollection GetByTaskID(int TaskID)
        {
            var commentRepo = new CommentRepository();
            var comments    = new CommentCollection();

            var commentsDTO = commentRepo.FetchAll(new CommentCriteria()
            {
                TaskID = TaskID
            });

            foreach (DTO.CommentDTO commentDto in commentsDTO)
            {
                var comment = Comment.CreateCommentFromDTO(commentDto);
                comment.MarkOld();
                comments.Add(comment);
            }

            return(comments);
        }
示例#3
0
 public Task()
 {
     _comments = new CommentCollection();
 }