public async Task <IActionResult> PutPerson(int id, Person person) { if (id != person.personId) { return(BadRequest()); } _context.Entry(person).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PersonExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public void Guncelle(Calisan calisan) { using (CrudDbContext db = new CrudDbContext()) { db.Entry(calisan).State = EntityState.Modified; db.SaveChanges(); } }
public ActionResult Edit(int id, Person person) { using(CrudDbContext db = new CrudDbContext()) { db.Entry(person).State = EntityState.Modified; db.SaveChanges(); } return RedirectToAction("Index"); }
public ActionResult Edit([Bind(Include = "userID,first_name,last_name,date,gender,mobile,email,pswd,category")] User user) { if (ModelState.IsValid) { db.Entry(user).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(user)); }
public void Guncelle(T entity) { dbSet.Attach(entity); db.Entry(entity).State = EntityState.Modified; db.SaveChanges(); }