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