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); }
/// <inheritdoc/> public override Task <CommitAggregateEventsResponse> CommitForAggregate(CommitAggregateEventsRequest request, ServerCallContext context) => _eventStore.CommitAggregateEvents(request, context.CancellationToken);
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); }