コード例 #1
0
        public ActionResult Edit(Volunteer volunteer)
        {
            VolunteerContext volunteerContext = new VolunteerContext();

            volunteerContext.Entry(volunteer).State = System.Data.Entity.EntityState.Modified;
            volunteerContext.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "Email,FirstName,LastName,Username,Password,Center,Interests,Availability,Address,PhoneNumber,Education,Licenses,EMCname,EMCphone,EMCemail,EMCaddress,DriversLicenseOnFile,SocialCardOnFile,ApprovalStatus")] VolunteerModel volunteerModel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(volunteerModel).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(volunteerModel));
 }
コード例 #3
0
 public virtual void Update(T entity)
 {
     dbset.Attach(entity);
     dataContext.Entry(entity).State = EntityState.Modified;
 }