Example #1
0
        public void Process(DeletionRequestReceived deletionRequest, EffectTracker effects)
        {
            int numberInstancesDeleted = 0;

            if (this.OrchestrationState != null &&
                (!deletionRequest.CreatedTime.HasValue || deletionRequest.CreatedTime.Value == this.OrchestrationState.CreatedTime))
            {
                this.OrchestrationState = null;
                numberInstancesDeleted++;

                // we also delete this instance's history, and pending operations on it
                effects.Add(TrackedObjectKey.History(this.InstanceId));
                effects.Add(TrackedObjectKey.Sessions);
            }

            if (!effects.IsReplaying)
            {
                this.Partition.Send(new DeletionResponseReceived()
                {
                    ClientId  = deletionRequest.ClientId,
                    RequestId = deletionRequest.RequestId,
                    NumberInstancesDeleted = numberInstancesDeleted,
                });
            }
        }
 public void Process(DeletionRequestReceived deletionRequestReceived, EffectTracker effects)
 {
     this.DeleteHistory();
 }