public void AddBug(IIssueFactory issueFactory, AddBugToTask command) { if (Status == IssueStatus.Done) { throw new CannotAddChildIssueWhenParentIssueIsDone <Task, ChildBug>(Id); } var bug = System.Threading.Tasks.Task.Run(() => issueFactory.GenerateChildBug(command)).GetAwaiter().GetResult(); Bugs.Add(bug); Update(new BugAddedToTask(bug.Id, Id, ProjectId, bug.Title, bug.Description, bug.ReporterId, bug.AssigneeId, bug.Labels.Select(x => x.Id).ToList(), bug.CreatedAt)); }
public async System.Threading.Tasks.Task AddBug(IIssueFactory issueFactory, AddBugToNfr command) { if (Status == IssueStatus.Done) { throw new CannotAddChildIssueWhenParentIssueIsDone <Nfr, ChildBug>(Id); } var bug = await issueFactory.GenerateChildBug(command); Bugs.Add(bug); Update(new BugAddedToNfr(bug.Id, Id, ProjectId, bug.Title, bug.Description, bug.ReporterId, bug.AssigneeId, bug.Labels.Select(x => x.Id).ToList(), bug.CreatedAt)); }