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

            db.Orders.Add(vm.ToNewDb());
            db.SaveChanges();

            return CreatedAtRoute("GetOrder", new { id = vm.Id }, vm);
        }
        public IHttpActionResult PutOrder(int id, OrderViewModel vm)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != vm.Id)
            {
                return BadRequest();
            }

            var order = db.Orders.Find(vm.Id);
            vm.UpdateDb(order);
            db.Entry(order).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!OrderExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }