Exemplo n.º 1
0
    private async Task UpdateEventStatus(string eventId, EventStateEnum status)
    {
        var eventLogEntry = await _dbContext.IntegrationEventLogs
                            .SingleAsync(ie => ie.EventId == eventId);

        eventLogEntry.State = status;

        if (status == EventStateEnum.InProgress)
        {
            eventLogEntry.TimesSent++;
        }

        await _dbContext.SaveChangesAsync();
    }
Exemplo n.º 2
0
    public async Task SetCurrentOperationCompletedAsync(string result, CancellationToken cancellationToken)
    {
        if (string.IsNullOrWhiteSpace(result))
        {
            return;
        }

        var operation = await GetOperationAsync(cancellationToken);

        if (operation != null)
        {
            operation.OperationResult = result;
        }

        await _dbContext.SaveChangesAsync(cancellationToken);
    }