public async Task <GetIdeaCommentByIdResponse> Handle(GetIdeaCommentByIdRequest request)
 {
     return(new GetIdeaCommentByIdResponse()
     {
         IdeaComment = IdeaCommentApiModel.FromIdeaComment(await _context.IdeaComments.SingleAsync(x => x.Id == request.Id && x.TenantId == request.TenantId))
     });
 }
Exemplo n.º 2
0
            public async Task <GetIdeaCommentsResponse> Handle(GetIdeaCommentsRequest request)
            {
                var ideaComments = await _context.IdeaComments
                                   .Where(x => x.TenantId == request.TenantId)
                                   .ToListAsync();

                return(new GetIdeaCommentsResponse()
                {
                    IdeaComments = ideaComments.Select(x => IdeaCommentApiModel.FromIdeaComment(x)).ToList()
                });
            }