public async Task HandleAsync(AssignLabelsToTasksBug command) { var task = await taskRepository.GetAsync(command.TaskId); var originalVersion = task.Version; var labels = await labelsSearcher.GetLabels(task.ProjectId); task.AssignLabelsToBug(command.IssueId, command.LabelsIds, labels); var bug = task.Bugs.Single(x => x.Id == command.IssueId); await taskRepository.UpdateChildEntity(task, originalVersion, bug); }
public async Task <IActionResult> AssignLabelsToBug([FromRoute] Guid projectId, [FromRoute] Guid taskId, [FromRoute] Guid bugId, [FromBody] AssignLabelsToTasksBug command) { command.ProjectId = projectId; command.TaskId = taskId; command.IssueId = bugId; await commandQueryBus.SendAsync(command); return(Ok()); }