コード例 #1
0
    public async Task <CommitForAggregateResponse> CommitForAggregate(CommitForAggregateRequest request)
    {
        var result = await _eventStore.CommitAggregateEvents(request, HttpContext.RequestAborted).ConfigureAwait(false);

        if (result.Failure is not null)
        {
            Response.StatusCode = StatusCodes.Status500InternalServerError;
        }

        return(result);
    }
コード例 #2
0
 /// <inheritdoc/>
 public override Task <CommitAggregateEventsResponse> CommitForAggregate(CommitAggregateEventsRequest request, ServerCallContext context)
 => _eventStore.CommitAggregateEvents(request, context.CancellationToken);
コード例 #3
0
    public static async Task <CommitAggregateEventsResponse> Commit(this IEventStore eventStore, UncommittedAggregateEvents events, Dolittle.Runtime.Execution.ExecutionContext executionContext)
    {
        var response = await eventStore.CommitAggregateEvents(events.ToCommitRequest(executionContext), CancellationToken.None);

        return(response);
    }