public IHttpActionResult PostWorkOrder(WorkOrderModel workOrder)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            var dbWorkOrder = new WorkOrder();
            dbWorkOrder.User = db.Users.FirstOrDefault(u => u.UserName == User.Identity.Name);
            dbWorkOrder.Update(workOrder);

            db.WorkOrders.Add(dbWorkOrder);
            db.SaveChanges();

            workOrder.WorkOrderId = dbWorkOrder.WorkOrderId;

            return CreatedAtRoute("DefaultApi", new { id = workOrder.WorkOrderId }, workOrder);
        }
        public IHttpActionResult PostWorkOrder(WorkOrderModel workOrder)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            var dbWorkOrder = new WorkOrder();

            // Lease doesn't need the following code in POST because it's not being created directly by the user
            // dbWorkOrder.User = db.Users.FirstOrDefault(u => u.UserName == User.Identity.Name);

            dbWorkOrder.Update(workOrder);

            db.WorkOrders.Add(dbWorkOrder);
            db.SaveChanges();

            workOrder.WorkOrderId = dbWorkOrder.WorkOrderId;

            return CreatedAtRoute("DefaultApi", new { id = workOrder.WorkOrderId }, workOrder);
        }