public async Task <T> UpdateAsync(T model) { _context.Entry(model); _context.Update(model); await _context.SaveChangesAsync(); return(model); }
public ActionResult Edit([Bind(Include = "Id,Name,KilometersHourSpeed")] PlaneKind plane) { if (ModelState.IsValid) { db.Entry(plane).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(plane)); }