private async Task <IssueDTODetailed> CreateDtoFromIssue(Issue issue, bool getAssignedUsers, bool getConversations, bool getTimeSheets, bool getParent, bool getChildren, bool getPredecessors, bool getSuccessors, bool getAll) { var issueDto = _issueService.Get(issue.Id); var assignedUsers = getAll || getAssignedUsers?Task.WhenAll(issue.AssignedUserIds.Select(_userRepository.GetAsync)) : null; var conversations = getAll || getConversations?_conversationService.GetConversationsFromIssueAsync(issue.Id.ToString()) : null; var timeSheets = getAll || getTimeSheets?_timeSheetService.GetAllOfIssueAsync(issue.Id) : null; var parent = getAll || getParent?_issueParentService.GetParent(issue.Id) : null; var children = getAll || getChildren?_issueChildrenService.GetAll(issue.Id, false) : null; var predecessors = getAll || getPredecessors?Task.WhenAll(issue.PredecessorIssueIds.Select(_issueService.Get)) : null; var successors = getAll || getSuccessors?Task.WhenAll(issue.SuccessorIssueIds.Select(_issueService.Get)) : null; return(new IssueDTODetailed((await issueDto).Id, (await issueDto).State, (await issueDto).Project, (await issueDto).Client, (await issueDto).Author, assignedUsers != null ? (await assignedUsers).Select(it => new UserDTO(it)).ToList() : null, conversations != null ? await conversations : null, timeSheets != null ? await timeSheets : null, issue.IssueDetail, parent != null ? await parent : null, children != null ? await children : null, predecessors != null ? await predecessors : null, successors != null ? await successors : null)); }
public async Task <ActionResult <IList <IssueTimeSheetDTO> > > GetAll([FromRoute] ObjectId issueId) { return(Ok(await _timeSheetService.GetAllOfIssueAsync(issueId))); }