Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 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();
        }
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 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();
 }
Exemplo n.º 7
0
 public void Handle(ProjectionVersionRequestCanceled @event)
 {
     State.Id = @event.Id;
     State.AllVersions.Add(@event.Version);
 }
Exemplo n.º 8
0
 public Task HandleAsync(ProjectionVersionRequestCanceled @event)
 {
     State.Id = @event.Id;
     State.AllVersions.Add(@event.Version);
     return(Task.CompletedTask);
 }