public IHttpActionResult PutCarlosRiosFriend(int id, CarlosRiosFriend carlosRiosFriend) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != carlosRiosFriend.Llave) { return(BadRequest()); } db.Entry(carlosRiosFriend).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!CarlosRiosFriendExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult DeleteConfirmed(int id) { CarlosRiosFriend carlosRiosFriend = db.CarlosRiosFriends.Find(id); db.CarlosRiosFriends.Remove(carlosRiosFriend); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Llave,NombreCompleto,TipoAmigo,Apodo,Cumpleaños")] CarlosRiosFriend carlosRiosFriend) { if (ModelState.IsValid) { db.Entry(carlosRiosFriend).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(carlosRiosFriend)); }
public ActionResult Create([Bind(Include = "Llave,NombreCompleto,TipoAmigo,Apodo,Cumpleaños")] CarlosRiosFriend carlosRiosFriend) { if (ModelState.IsValid) { db.CarlosRiosFriends.Add(carlosRiosFriend); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(carlosRiosFriend)); }
public IHttpActionResult GetCarlosRiosFriend(int id) { CarlosRiosFriend carlosRiosFriend = db.CarlosRiosFriends.Find(id); if (carlosRiosFriend == null) { return(NotFound()); } return(Ok(carlosRiosFriend)); }
public IHttpActionResult PostCarlosRiosFriend(CarlosRiosFriend carlosRiosFriend) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.CarlosRiosFriends.Add(carlosRiosFriend); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = carlosRiosFriend.Llave }, carlosRiosFriend)); }
// GET: CarlosRiosFriends/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CarlosRiosFriend carlosRiosFriend = db.CarlosRiosFriends.Find(id); if (carlosRiosFriend == null) { return(HttpNotFound()); } return(View(carlosRiosFriend)); }
public IHttpActionResult DeleteCarlosRiosFriend(int id) { CarlosRiosFriend carlosRiosFriend = db.CarlosRiosFriends.Find(id); if (carlosRiosFriend == null) { return(NotFound()); } db.CarlosRiosFriends.Remove(carlosRiosFriend); db.SaveChanges(); return(Ok(carlosRiosFriend)); }