public ICollection <CommentDto> FindAllComments(long eventId, int startIndex, int count) { Event myEvent = EventDao.Find(eventId); ICollection <Comment> comments = CommentDao.FindCommentsOrderByDate(eventId, startIndex, count); ICollection <CommentDto> commentsDto = new HashSet <CommentDto>(); foreach (Comment comment in comments) { commentsDto.Add(new CommentDto(comment, eventId)); } return(commentsDto); }
public Comment AddComment(string comment, long eventId, long userId) { Event e = EventDao.Find(eventId); UserProfile u = UserProfileDao.Find(userId); Comment c = new Comment(); c.content = comment; c.Event = e; c.UserProfile = u; c.commentDate = DateTime.Now; c.Labels = new List <Label>(); c.loginName = u.loginName; CommentDao.Create(c); return(c); }
public Event FindEventById(long eventId) { Event myEvent = EventDao.Find(eventId); return(myEvent); }