public void CancelVersionRequest()
 {
     if (CanCancel())
     {
         var projectionVersion = state.All.Versions.Where(x => x.Status == ProjectionStatus.Building).Single();
         var @event            = new ProjectionVersionRequestCanceled(state.Id, projectionVersion.WithStatus(ProjectionStatus.Canceled));
         Apply(@event);
     }
 }
Example #2
0
        public void CancelVersionRequest(ProjectionVersion version, string reason)
        {
            if (CanCancel(version))
            {
                var @event = new ProjectionVersionRequestCanceled(state.Id, version.WithStatus(ProjectionStatus.Canceled), reason);
                Apply(@event);
            }

            EnsureThereIsNoOutdatedBuildingVersions();
        }
        public void CancelVersionRequest(ProjectionVersion version, string reason)
        {
            if (CanCancel(version))
            {
                if (version.MaybeIsBroken())
                {
                    foreach (ProjectionVersion buildingVersion in state.Versions.GetBuildingVersions())
                    {
                        ProjectionVersionRequestCanceled reset = new ProjectionVersionRequestCanceled(state.Id, buildingVersion.WithStatus(ProjectionStatus.Canceled), reason + " Something wrong has happened. We are trying to reset the state so you could try rebuild/replay the state.");
                        Apply(reset);
                    }
                }

                var @event = new ProjectionVersionRequestCanceled(state.Id, version.WithStatus(ProjectionStatus.Canceled), reason);
                Apply(@event);
            }
        }
Example #4
0
 public void Handle(ProjectionVersionRequestCanceled @event)
 {
     projectionVersionStore.Cache(@event.Version);
 }
 public Task HandleAsync(ProjectionVersionRequestCanceled @event)
 {
     projectionVersionStore.Cache(@event.Version);
     return(Task.CompletedTask);
 }
 public void When(ProjectionVersionRequestCanceled e)
 {
     Id = e.Id;
     Versions.Add(e.Version);
     LastVersionRequestTimebox = LastVersionRequestTimebox.Reset();
 }
Example #7
0
 public void Handle(ProjectionVersionRequestCanceled @event)
 {
     State.Id = @event.Id;
     State.AllVersions.Add(@event.Version);
 }
 public Task HandleAsync(ProjectionVersionRequestCanceled @event)
 {
     State.Id = @event.Id;
     State.AllVersions.Add(@event.Version);
     return(Task.CompletedTask);
 }