public Task Handle(IssueOrderEvent theEvent)
        {
            var order = theEvent.DataContract;

            TheLogger.LogInformation($"OrderId={order.Id} ShipAddres={order.ShipAddress}");
            return(Task.CompletedTask);
        }
Ejemplo n.º 2
0
        public Task <bool> Handle(IssueOrderCmd request, CancellationToken cancellationToken)
        {
            TheLogger.LogInformation($"IssueOrderCmdHandler OrderId={request.DataContract.Id}");
            var issueOrderEvent = new IssueOrderEvent()
            {
                DataContract = request.DataContract
            };

            TheEventBus.PublishEvent(issueOrderEvent);
            return(Task.FromResult(true));
        }
Ejemplo n.º 3
0
        public Task <Order> Handle(QueryOrderCmd request, CancellationToken cancellationToken)
        {
            string orderId = request.DataContract;

            TheLogger.LogInformation($"IssueOrderCmdHandler OrderId={orderId}");
            var order = new Order()
            {
                Id = orderId, CustomerId = "R3234566777", ShipAddress = "台北市信義路四段11號"
            };

            return(Task.FromResult(order));
        }