public IHttpActionResult PostOrder(OrderViewModel order_view_model)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            Order order = new Order { Customer_Id=order_view_model.Customer_Id, OrderDate=DateTime.Now };
            //order.OrderDetails = new List<OrderDetail>();
            Product product;
            foreach (var detail in order_view_model.OrderDetails)
            {
                product = db.Products.Find(detail.Product_Id);
                order.OrderDetails.Add(new OrderDetail { Product=product, Quantity=detail.Quantity });
            }
            db.Orders.Add(order);
            db.SaveChanges();

            return CreatedAtRoute("DefaultApi", new { id = order.Id }, order);
        }
        OrderViewModel toOrderViewModel(Order order)
        {
            var orderViewModel = new OrderViewModel {   Id=order.Id,
                                                                                Customer_Id=order.Customer_Id,
                                                                                OrderDate=order.OrderDate,
                                                                                TimestampString=Convert.ToBase64String(order.Timestamp) };

            orderViewModel.OrderDetails = new List<OrderDetailViewModel>();
            foreach (var detail in order.OrderDetails)
            {
                orderViewModel.OrderDetails.Add(new OrderDetailViewModel
                {
                    Order_Id = order.Id,
                    Product_Id = detail.Product_Id,
                    ProductName = detail.Product.Name,
                    Quantity = detail.Quantity
                });
            }
            return orderViewModel;
        }