public async Task HandleAsync(AssignLabelsToBug command) { var Bug = await bugRepository.GetAsync(command.IssueId); var labels = await labelsSearcher.GetLabels(Bug.ProjectId, command.LabelsIds); Bug.AssignLabels(command.LabelsIds, labels); await bugRepository.Update(Bug, Bug.Version); }
public async Task <IActionResult> AssignLabels([FromRoute] Guid projectId, [FromRoute] Guid bugId, [FromBody] AssignLabelsToBug command) { command.ProjectId = projectId; command.IssueId = bugId; await commandQueryBus.SendAsync(command); return(Ok()); }