// PUT api/Friend/5 public IHttpActionResult PutFriend(int id, Friend friend) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != friend.ID) { return(BadRequest()); } db.Entry(friend).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!FriendExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult Edit([Bind(Include = "Id,Name,Phone,Email,City")] Friend friend) { if (ModelState.IsValid) { db.Entry(friend).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(friend)); }
public ActionResult Edit([Bind(Include = "indeks,id,ime,mestonaziveenje")] FriendModel friendModel) { if (ModelState.IsValid) { db.Entry(friendModel).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(friendModel)); }
public ActionResult Edit([Bind(Include = "ID,FriendID,Name,Hometown")] FriendModel friendModel) { if (ModelState.IsValid) { db.Entry(friendModel).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(friendModel)); }