Beispiel #1
0
        List <CommentQueryData> ICommentService.GetComment(CommentFetchingFilter filter)
        {
            var queryList = commentRepository.GetComment(filter);
            List <CommentQueryData> result = new List <CommentQueryData>();

            foreach (var comment in queryList)
            {
                result.Add(new CommentQueryData(comment));
            }
            return(result);
        }
Beispiel #2
0
        List <Comment> ICommentRepository.GetComment(CommentFetchingFilter filter)
        {
            List <Comment> result      = new List <Comment>();
            var            commentList = dbContext.Comments
                                         .Include(c => c.Report)
                                         .Include(c => c.User);

            result = (from records in commentList select records).ToList();

            if (filter.ReportId.HasValue)
            {
                result = result.FilterCommentsByReportId(filter.ReportId.Value).ToList();
            }

            return(result);
        }