public async Task <ActionResult> CreatePersonReportsByLocation(CreatePersonReportsByLocationCommand command) { var context = CorrelationContext.Create(Guid.NewGuid(), command.PersonId); await BusPublisher.SendAsync(command, context); return(Accepted(context)); }
public async Task HandleAsync(SynchronizationAcceptedEvent @event, ISagaContext sagaContext) { logger.LogInformation($"{nameof(@event)} ({sagaContext.CorrelationId}) {this.GetType()}"); await busPublisher.SendAsync( new MergeSynchronizationDataCommand(), CorrelationContext.Create(sagaContext.CorrelationId)); }
protected CorrelationContext GetContext <T>(Guid?resourceId = null, string resource = "") where T : ICommand { if (!string.IsNullOrWhiteSpace(resource)) { resource = $"{resource}/{resourceId}"; } return(CorrelationContext.Create <T>(Guid.NewGuid(), Guid.NewGuid(), resourceId ?? Guid.Empty, Request.Path.ToString(), Culture, resource)); }
protected ICorrelationContext GetContext <T>(Guid?resourceId = null, string resource = "") where T : ICommand { if (!string.IsNullOrWhiteSpace(resource)) { resource = $"{resource}/{resourceId}"; } return(CorrelationContext.Create <T>(Guid.NewGuid(), UserId, resourceId ?? Guid.Empty)); }
protected ICorrelationContext GetContext(Guid?resourceId = null, string resource = "") { if (!string.IsNullOrWhiteSpace(resource)) { resource = $"{resource}/{resourceId}"; } return(CorrelationContext.Create <int>(Guid.NewGuid(), Guid.Empty, resourceId ?? Guid.Empty, "origin", "traceId", "context", "connectionId", "culture", resource)); }
protected ICorrelationContext GetContext <T>(Guid?resourceId = null, string resource = "") where T : IRequest { if (!string.IsNullOrWhiteSpace(resource)) { resource = $"{resource}/{resourceId}"; } return(CorrelationContext.Create <T>(Guid.NewGuid(), UserId, resourceId ?? Guid.Empty, HttpContext.TraceIdentifier, Request.Path.ToString(), Culture, resource)); }
protected ICorrelationContext GetContext <T>(Guid?resourceId = null, string resource = "") where T : ICommand { if (!string.IsNullOrWhiteSpace(resource)) { resource = $"{resource}/{resourceId}"; } //send SpanTracerContext of our tracer with request return(CorrelationContext.Create <T>(Guid.NewGuid(), UserId, resourceId ?? Guid.Empty, HttpContext.TraceIdentifier, HttpContext.Connection.Id, _tracer.ActiveSpan.Context.ToString(), Request.Path.ToString(), Culture, resource)); }
protected ICorrelationContext GetContext <T>(string resourceId = "", string resource = "") where T : ICommand { if (!string.IsNullOrWhiteSpace(resource)) { resource = $"{resource}/{resourceId}"; } return(CorrelationContext.Create <T>(SagaId.NewSagaId(), UserId, resourceId, HttpContext.TraceIdentifier, HttpContext.Connection.Id, Tracer?.ActiveSpan?.Context?.ToString() ?? "", Request.Path.ToString(), Culture, resource)); }
private ICorrelationContext GetContext() => CorrelationContext.Create <GreetUser>( id: Guid.NewGuid(), userId: Guid.NewGuid(), resourceId: Guid.NewGuid(), origin: "api/values", traceId: _tracer.ActiveSpan.Context.TraceId.ToString(), spanContext: _tracer.ActiveSpan.Context.ToString(), connectionId: "", culture: "", resource: "");
protected Task <ICorrelationContext> GetContextAsync <T>(Guid?resourceId = null, string resource = "") where T : IMessage { var(identityClaim, issuerClaim) = GetIdentityClaims(); if (!string.IsNullOrWhiteSpace(resource)) { resource = $"{resource}/{resourceId}"; } return(Task.FromResult(CorrelationContext.Create <T>(Guid.NewGuid(), UserId, resourceId ?? Guid.Empty, HttpContext.TraceIdentifier, HttpContext.Connection.Id, Request.Path.ToString(), Culture, resource))); }
//This method is only for AllowAnonymus CustomerController protected ICorrelationContext GetContext(Guid customerId) { return(CorrelationContext.Create(Guid.NewGuid(), customerId)); }
public Task HandleAsync(SynchronizationScheduledEvent @event) => HandleAsync(@event, CorrelationContext.Create());
public Task HandleAsync(AcceptSynchronizationCommand command) => HandleAsync(command, CorrelationContext.Create());
public Task HandleAsync(MergeSynchronizationDataCommand command) => HandleAsync(command, CorrelationContext.Create());
public async Task <IActionResult> AcceptSynchronization(AcceptSynchronizationCommand command) { await busPublisher.SendAsync(command, CorrelationContext.Create()); return(Accepted()); }
public Task HandleAsync(TEvent @event) => HandleAsync(@event, CorrelationContext.Create());