public async Task <AggregatedResponse <TResponse> > Send <TResponse>( object request, CancellationToken cancellationToken = default) { if (request is null) { throw new ArgumentNullException(nameof(request)); } var recipients = _scope.ListRecipientsReplyingWith(request.GetType(), typeof(TResponse)); var runners = await Invoke <TResponse>(recipients, request, cancellationToken).ConfigureAwait(false); return(AggregatedResponseFactory.CreateFrom(runners)); }
public async Task <AggregatedResponse <object?> > Send( object request, CancellationToken cancellationToken = default) { if (request is null) { throw new ArgumentNullException(nameof(request)); } var recipients = _scope.ListRecipientsAccepting(request.GetType()); var invocations = await Invoke(recipients, request, cancellationToken).ConfigureAwait(false); return(AggregatedResponseFactory.CreateFrom(invocations)); }