예제 #1
0
 public ActionResult Edit(UserProfile userprofile)
 {
     if(ModelState.IsValid) {
         context.Entry(userprofile).State = EntityState.Modified;
         context.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(userprofile);
 }
예제 #2
0
        public ActionResult Create(UserProfile userprofile)
        {
            if(ModelState.IsValid) {
                context.UserProfiles.Add(userprofile);
                context.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(userprofile);
        }