コード例 #1
0
        public async Task <OrderPlaced> Handle(PlaceOrderCommand command)
        {
            var orderId = CreateDomainModelFrom(command);
            var order   = await _orders.GetBy(orderId);

            order.Place(_clock.Now);
            await _orders.Save(order);

            return(CreateEventFrom(order));
        }
コード例 #2
0
 private static OrderId CreateDomainModelFrom(PlaceOrderCommand command) => OrderId.From(command.OrderId);