public ProjectionVersion Parse(string columnFamily) { var parts = columnFamily.Split('_'); if (parts.Length < 3) { throw new ArgumentException($"Unable to parse '{nameof(ProjectionVersion)}' from '{columnFamily}'.", nameof(columnFamily)); } if (int.TryParse(parts[1], out var revision) == false) { throw new ArgumentException($"Invalid projection revision '{parts[1]}'.", nameof(columnFamily)); } return(new ProjectionVersion(parts[0], ProjectionStatus.Create("unknown"), revision, parts[2])); }
public IActionResult Finalize([FromBody] RequestModel model) { var version = new Projections.ProjectionVersion(model.ProjectionContractId, ProjectionStatus.Create(model.Version.Status), model.Version.Revision, model.Version.Hash); var command = new FinalizeProjectionVersionRequest(new ProjectionVersionManagerId(model.ProjectionContractId, context.Tenant), version); if (_publisher.Publish(command)) { return(new OkObjectResult(new ResponseResult())); } return(new BadRequestObjectResult(new ResponseResult <string>($"Unable to publish command '{nameof(FinalizeProjectionVersionRequest)}'"))); }