Beispiel #1
0
        public async Task Handle(TradeCreated message)
        {
            Console.WriteLine($"New trade created: {message.TradeId}");

            await MaybeOrderTimeout();

            Data.Counterparty = message.Counterparty;

            await MaybeCompleteSaga();
        }
Beispiel #2
0
        public async Task <TradeCreationResult> Create([FromBody] TradeCreationDto tradeCreationDemand)
        {
            var result = await _repository.Create(tradeCreationDemand);

            var @event = new TradeCreated()
            {
                TradeId = result.TradeId
            };

            await _tradeEventProcessor.Emit(@event);

            return(result);
        }