public async Task HandleAsync(AssignNfrsBugToSprint command) { var nfr = await nfrRepository.GetAsync(command.NfrId); var originalVersion = nfr.Version; await nfr.AssignBugToSprint(command.IssueId, command.SprintId, sprintSearcher); var bug = nfr.Bugs.Single(x => x.Id == command.IssueId); await nfrRepository.UpdateChildEntity(nfr, originalVersion, bug); }
public async Task <IActionResult> AssignBugToSprint([FromRoute] Guid projectId, [FromRoute] Guid nfrId, [FromRoute] Guid bugId, [FromBody] AssignNfrsBugToSprint command) { command.ProjectId = projectId; command.NfrId = nfrId; command.IssueId = bugId; await commandQueryBus.SendAsync(command); return(Ok()); }