public IActionResult Cancel([FromBody] RequestModel model) { var version = new Projections.ProjectionVersion(model.ProjectionContractId, ProjectionStatus.Create(model.Version.Status), model.Version.Revision, model.Version.Hash); var command = new CancelProjectionVersionRequest(new ProjectionVersionManagerId(model.ProjectionContractId, context.Tenant), version, model.Reason ?? "Canceled by user"); if (_publisher.Publish(command)) { return(new OkObjectResult(new ResponseResult())); } return(new BadRequestObjectResult(new ResponseResult <string>($"Unable to publish command '{nameof(CancelProjectionVersionRequest)}'"))); }
public void Handle(CancelProjectionVersionRequest command) { Update(command.Id, ar => ar.CancelVersionRequest(command.Version, command.Reason)); }