public override async Task <BestMatchCarParkCommand> HandleAsync(BestMatchCarParkCommand command, CancellationToken cancellationToken = new CancellationToken()) { var bestCarPark = BestMatchCalculator.CalculateBestMatch(command.CarParks); command.BestMatch = bestCarPark; return(await base.HandleAsync(command, cancellationToken)); }
public BestMatchCarParkActor() { Receive <BestMatchCarParkMessage>(message => { var bestCarPark = BestMatchCalculator.CalculateBestMatch(message.CarParks); Sender.Tell(bestCarPark); }); }
public BestMatchCarParkActor() { var outputActor = Context.ActorOf <CarParkToOutputActor>(); Receive <BestMatchCarParkMessage>(message => { var bestCarPark = BestMatchCalculator.CalculateBestMatch(message.CarParks); outputActor.Tell(new CarParkToOutputMessage(bestCarPark)); }); }
protected override Task <CarPark> HandleCore(BestMatchCarParkRequest request) { var bestCarPark = BestMatchCalculator.CalculateBestMatch(request.CarParks); return(Task.FromResult(bestCarPark)); }
public async Task <CarPark> Handle(BestMatchCarParkQuery query) { var bestCarPark = BestMatchCalculator.CalculateBestMatch(query.CarParks); return(await Task.FromResult(bestCarPark)); }