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