コード例 #1
0
 public ActionResult Edit([Bind(Include = "Id,Email,EmailConfirmed,PasswordHash,SecurityStamp,PhoneNumber,PhoneNumberConfirmed,TwoFactorEnabled,LockoutEndDateUtc,LockoutEnabled,AccessFailedCount,UserName,FirstName,ConfirmedEmail,LastName,Program,Semester,StudentId,ProfileImage")] AspNetUser aspNetUser)
 {
     if (ModelState.IsValid)
     {
         db.Entry(aspNetUser).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(aspNetUser));
 }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "Id,BookTitle,BookPath,UserId,AddedOn,UpdatedOn,BookDescription,AuthorName,BookPrice")] Book book)
 {
     if (ModelState.IsValid)
     {
         db.Entry(book).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.UserId = new SelectList(db.AspNetUsers, "Id", "Email", book.UserId);
     return(View(book));
 }
コード例 #3
0
 public ActionResult Edit(Book book)
 {
     if (ModelState.IsValid)
     {
         book.UpdatedOn       = DateTime.Now;
         book.UserId          = User.Identity.GetUserId();
         db.Entry(book).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.UserId = new SelectList(db.AspNetUsers, "Id", "Email", book.UserId);
     return(View(book));
 }