예제 #1
0
        public async Task <T> UpdateAsync(T model)
        {
            _context.Entry(model);
            _context.Update(model);
            await _context.SaveChangesAsync();

            return(model);
        }
예제 #2
0
 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));
 }