Exemplo n.º 1
0
 public bool Update(T entity)
 {
     _context.Entry(entity).State = EntityState.Detached;
     _context.Entry(entity).State = EntityState.Modified;
     _context.SaveChanges();
     return(true);
 }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,Name")] Customer link)
 {
     if (ModelState.IsValid)
     {
         _context.Entry(link).State = EntityState.Modified;
         _context.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(link));
 }