Пример #1
0
    public async ValueTask HandleAsync(
        JobCompletedEvent domainEvent,
        JobsListEventItem eventItem,
        CancellationToken cancellationToken = default)
    {
        (Guid id, string?_, JobListInfo? jobListInfo) = domainEvent;

        JobItem item = await _repository.GetAsync(
            id.ToString(),
            jobListInfo.Id.ToString(),
            cancellationToken);

        item.Complete(domainEvent.OccuredUtc);

        await _repository.UpdateAsync(
            item,
            cancellationToken);
    }