Beispiel #1
0
        public async Task <Unit> Handle(UpdateProjectCommentCommand request, CancellationToken cancellationToken)
        {
            var projectComment = await _projectCommentRepository.GetProjectCommentByIdAsync(request.Id);

            //projectComment.Update(request.Content);

            await _projectCommentRepository.SaveChangesAsync();

            return(Unit.Value);
        }
Beispiel #2
0
        public async Task <ProjectCommentViewModel> Handle(GetProjectCommentByIdQuery request, CancellationToken cancellationToken)
        {
            var projectComment = await _projectCommentRepository.GetProjectCommentByIdAsync(request.Id);

            if (projectComment == null)
            {
                return(null);
            }

            var projectCommentViewAllModel = new ProjectCommentViewModel();

            //var projectCommentViewAllModel = new ProjectCommentViewModel(
            //        projectComment.Id,
            //        projectComment.Content,
            //        projectComment.Project.Title,
            //        projectComment.User.FullName
            //    );

            return(projectCommentViewAllModel);
        }