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)); }
private static OrderId CreateDomainModelFrom(PlaceOrderCommand command) => OrderId.From(command.OrderId);