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