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); }
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); }
public Task() { _comments = new CommentCollection(); }