예제 #1
0
        public bool Update(L entity)
        {
            DbSet <L> dbSet = DB.Set <L>();

            DB.Entry(entity).State = EntityState.Modified;
            DB.SaveChanges();
            return(true);
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "ID,Name")] Manager manager)
 {
     if (ModelState.IsValid)
     {
         db.Entry(manager).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(manager));
 }
 public ActionResult Edit([Bind(Include = "ID,Name,Age")] Participant participant)
 {
     if (ModelState.IsValid)
     {
         db.Entry(participant).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(participant));
 }