public IssueDto MapIssueToIssueDto(Domain.Entities.IssueAggregate.Issue issue)
 {
     if (issue is null)
     {
         return(null);
     }
     return(new IssueDto
     {
         Title = issue.Title,
         Type = issue.Type,
         Status = issue.Status,
         Assignee = MapUserToUserDto(issue.Assignee),
         Description = issue.Description
     });
 }
        public async Task Handle(CreateIssueCommand command, CancellationToken cancellationToken)
        {
            var projectSpecification = new ProjectSpecification(command.ProjectId);
            var project = await _projectRepository.GetSingleOrDefaultAsync(projectSpecification);

            Check.NotNull(project, nameof(project));
            string issueId = (project.Issues.Count() + 1).ToString() + project.Key.ToUpper();
            var    issue   = new Domain.Entities.IssueAggregate.Issue(
                issueId,
                command.Type,
                command.Title,
                command.Description,
                _currentUserService.User,
                project, command.Status);

            _issueRepository.Add(issue);
            await _unitOfWork.SaveChangesAsync();
        }