public ActionResult Edit([Bind(Include = "userID,is_public,optIn,showEthnicity,showAge,showCountry,showGender,description,profileImgUrl")] UserProfile userProfile, [Bind(Include = "userID,firstName,lastName,ethnicity,birthdate,country,gender,")] UserInformation userInfo) { if (ModelState.IsValid) { db.Entry(userProfile).State = EntityState.Modified; db.Entry(userInfo).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("UserProfile", new { id = userProfile.userID })); } ViewBag.userID = new SelectList(db.AspNetUsers, "Id", "Email", userProfile.userID); return(View(userProfile)); }
public ActionResult Edit([Bind(Include = "usdaFoodID,userID")] SavedFood savedFood) { if (ModelState.IsValid) { db.Entry(savedFood).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(savedFood)); }
public ActionResult Edit([Bind(Include = "listID,userID,listName")] UserList userList) { userList.userID = User.Identity.GetUserId(); if (ModelState.IsValid) { db.Entry(userList).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(userList)); }