// Insert customer
 public HttpResponseMessage Post(Customer customer)
 {
     if(ModelState.IsValid)
     {
         customer.DateOfBirth = DateTime.Now;
         db.Customers.Add(customer);
         db.SaveChanges();
         HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, customer);
         response.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = customer.Id }));
         return response;
     }
     else
     {
         return Request.CreateResponse(HttpStatusCode.BadRequest, ModelState);
     }
 }
 // Update customer
 public HttpResponseMessage Put(int id, Customer customer)
 {
     if (!ModelState.IsValid)
     {
         return Request.CreateErrorResponse(HttpStatusCode.BadRequest,ModelState);
     }
     if(id!=customer.Id)
     {
         return Request.CreateResponse(HttpStatusCode.BadRequest);
     }
     db.Entry(customer).State = EntityState.Modified;
     try
     {
         db.SaveChanges();
     }
     catch (DbUpdateConcurrencyException ex)
     {
         return Request.CreateResponse(HttpStatusCode.NotFound, ex);
     }
     return Request.CreateResponse(HttpStatusCode.OK);
 }