public ActionResult Edit([Bind(Include = "Id,AppointmentDate,Description")] Appointments appointments) { if (ModelState.IsValid) { db.Entry(appointments).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(appointments)); }
public async Task <IActionResult> PutDataModel(string id, DataPlanner dataPlanner) { if (id != dataPlanner.Id) { return(BadRequest()); } _context.Entry(dataPlanner).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DataPlannerExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }