public IHttpActionResult PutUserContactDetail(int id, UserContactDetail userContactDetail) { if (id != userContactDetail.UserContactDetailUID) { return(BadRequest()); } db.Entry(userContactDetail).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!UserContactDetailExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PostUserContactDetail(UserContactDetail userContactDetail) { db.UserContactDetails.Add(userContactDetail); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = userContactDetail.UserContactDetailUID }, userContactDetail)); }
public IHttpActionResult GetUserContactDetail(int id) { UserContactDetail userContactDetail = db.UserContactDetails.Find(id); if (userContactDetail == null) { return(NotFound()); } return(Ok(userContactDetail)); }
public IHttpActionResult DeleteUserContactDetail(int id) { UserContactDetail userContactDetail = db.UserContactDetails.Find(id); if (userContactDetail == null) { return(NotFound()); } db.UserContactDetails.Remove(userContactDetail); db.SaveChanges(); return(Ok(userContactDetail)); }