コード例 #1
0
        public async Task <Models.Order> FindByNumber(int orderNumber)
        {
            Models.Order order = await findOrderByNumberAdapter.FindByNumberAsync(orderNumber);

            var orderExists = order != null;

            if (!orderExists)
            {
                throw new OrderNotFoundException($"Order {orderNumber} not found");
            }

            return(order);
        }
コード例 #2
0
        public async Task <bool> CancelOrderAsync(int orderNumber)
        {
            Models.Order order = await findOrderByNumberAdapter.FindByNumberAsync(orderNumber);

            return(await cancelOrderAdapter.CancelOrderAsync(order));
        }
コード例 #3
0
        public async Task <bool> ApproveOrderAsync(int orderNumber)
        {
            Models.Order order = await findOrderByNumberAdapter.FindByNumberAsync(orderNumber);

            return(await approveOrderAdapter.ApproveOrderAsync(order));
        }
コード例 #4
0
        public async Task <bool> DeliveryOrderAsync(int orderNumber)
        {
            Models.Order order = await findOrderByNumberAdapter.FindByNumberAsync(orderNumber);

            return(await deliveryOrderAdapter.DeliveryOrderAsync(order));
        }