Exemplo n.º 1
0
        public IActionResult PostOrder(Guid customerId, [FromBody] OrderDto orderDto)
        {
            ISpecification <Customer> specification = new CustomerByIdSpecification(Identity.Create(customerId));

            Customer customer = customerRepository.GetEntity(specification);
            Order    order    = orderDto.Execute(mapper.Map <OrderDto, Order>);

            customer.AddOrder(order);

            return(Ok());
        }