예제 #1
0
        public async Task <ResponseWrapper <CreatedOrder> > createNewOrder(
            [FromBody, BindRequired] CreateOrderDetails orderDetails)
        {
            var createdOrderId = await orderService.CreateNewOrder(
                this.DomainUser(),
                orderDetails.AsClientOrder()
                );

            var orderToReturn = (await lastUserOrders.LastUserOrder(this.DomainUser())) !;

            return(ResponseWrapper <CreatedOrder> .From(CreatedOrder.From(orderToReturn)));
        }
예제 #2
0
        public async Task <ResponseWrapper <SingleOrder> > createNewOrder(
            [FromBody, BindRequired] CreateOrderDetails orderDetails,
            [FromHeader(Name = "Registration-Token")] string registrationToken)
        {
            var createdOrderId = await orderService.CreateNewOrder(
                CreateClient(registrationToken),
                orderDetails.AsClientOrder()
                );

            var orderToReturn = (await orderDetailsRepository.OrderDetailsWithId(createdOrderId)) !;

            return(ResponseWrapper <SingleOrder> .From(SingleOrder.From(orderToReturn)));
        }