public IHttpActionResult PutAbuserRelationship(int id, AbuserRelationship abuserRelationship) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != abuserRelationship.AbuserRelationshipId) { return(BadRequest()); } db.Entry(abuserRelationship).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!AbuserRelationshipExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult DeleteConfirmed(int id) { AbuserRelationship abuserRelationship = db.AbuserRelationships.Find(id); db.AbuserRelationships.Remove(abuserRelationship); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "AbuserRelationshipId,Relationship")] AbuserRelationship abuserRelationship) { if (ModelState.IsValid) { db.Entry(abuserRelationship).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(abuserRelationship)); }
public ActionResult Create([Bind(Include = "AbuserRelationshipId,Relationship")] AbuserRelationship abuserRelationship) { if (ModelState.IsValid) { db.AbuserRelationships.Add(abuserRelationship); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(abuserRelationship)); }
public IHttpActionResult GetAbuserRelationship(int id) { AbuserRelationship abuserRelationship = db.AbuserRelationships.Find(id); if (abuserRelationship == null) { return(NotFound()); } return(Ok(abuserRelationship)); }
public IHttpActionResult PostAbuserRelationship(AbuserRelationship abuserRelationship) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.AbuserRelationships.Add(abuserRelationship); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = abuserRelationship.AbuserRelationshipId }, abuserRelationship)); }
// GET: AbuserRelationships/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AbuserRelationship abuserRelationship = db.AbuserRelationships.Find(id); if (abuserRelationship == null) { return(HttpNotFound()); } return(View(abuserRelationship)); }
public IHttpActionResult DeleteAbuserRelationship(int id) { AbuserRelationship abuserRelationship = db.AbuserRelationships.Find(id); if (abuserRelationship == null) { return(NotFound()); } db.AbuserRelationships.Remove(abuserRelationship); db.SaveChanges(); return(Ok(abuserRelationship)); }