Пример #1
0
        /// <inheritdoc/>
        public virtual async Task HandleAsync(V1WorkflowInstanciatedDomainEvent e, CancellationToken cancellationToken = default)
        {
            var workflow = await this.GetOrReconcileProjectionAsync(e.AggregateId, cancellationToken);

            workflow.LastModified     = e.CreatedAt.UtcDateTime;
            workflow.LastInstanciated = e.CreatedAt.UtcDateTime;
            workflow.TotalInstanceCount++;
            await this.Projections.UpdateAsync(workflow, cancellationToken);

            await this.Projections.SaveChangesAsync(cancellationToken);

            await this.PublishIntegrationEventAsync(e, cancellationToken);
        }
Пример #2
0
 /// <summary>
 /// Handles the specified <see cref="V1WorkflowInstanciatedDomainEvent"/>
 /// </summary>
 /// <param name="e">The <see cref="V1WorkflowInstanciatedDomainEvent"/> to handle</param>
 protected virtual void On(V1WorkflowInstanciatedDomainEvent e)
 {
     this.LastModified     = e.CreatedAt;
     this.LastInstanciated = e.CreatedAt;
 }