public IHttpActionResult PutCustomerVisaGot(int id, CustomerVisaGot customerVisaGot) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != customerVisaGot.ID) { return(BadRequest()); } db.Entry(customerVisaGot).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!CustomerVisaGotExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetCustomerVisaGot(int id) { CustomerVisaGot customerVisaGot = db.CustomerVisaGots.Find(id); if (customerVisaGot == null) { return(NotFound()); } return(Ok(customerVisaGot)); }
public IHttpActionResult PostCustomerVisaGot(CustomerVisaGot customerVisaGot) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.CustomerVisaGots.Add(customerVisaGot); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = customerVisaGot.ID }, customerVisaGot)); }
public IHttpActionResult DeleteCustomerVisaGot(int id) { CustomerVisaGot customerVisaGot = db.CustomerVisaGots.Find(id); if (customerVisaGot == null) { return(NotFound()); } db.CustomerVisaGots.Remove(customerVisaGot); db.SaveChanges(); return(Ok(customerVisaGot)); }