CQRS.NET  2.1
A lightweight enterprise framework to write CQRS, event-sourced and micro-service applications in hybrid multi-datacentre, on-premise and Azure environments.

◆ SendAndWait< TCommand, TEvent >() [4/6]

TEvent Cqrs.Commands.ISendAndWaitCommandSender< TAuthenticationToken >.SendAndWait< TCommand, TEvent > ( TCommand  command,
Func< IEnumerable< IEvent< TAuthenticationToken >>, TEvent >  condition,
IEventReceiver< TAuthenticationToken >  eventReceiver = null 
)

Sends the provided command and waits until the specified condition is satisfied an event of TEvent

Parameters
commandThe TCommand to send.
conditionA delegate to be executed over and over until it returns the TEvent that is desired, return null to keep trying.
eventReceiverIf provided, is the IEventReceiver<TAuthenticationToken> that the event is expected to be returned on.

Implemented in Cqrs.Bus.InProcessBus< TAuthenticationToken >, Cqrs.Akka.Commands.AkkaCommandBus< TAuthenticationToken >, Cqrs.Azure.ServiceBus.AzureCommandBusPublisher< TAuthenticationToken >, and Cqrs.Azure.ServiceBus.AzureCommandBusPublisher< TAuthenticationToken >.

Type Constraints
TCommand :ICommand<TAuthenticationToken>