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