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