public ActionResult Edit([Bind(Include = "AppointmentId,Date,startHour,state")] Appointment appointment) { if (ModelState.IsValid) { db.Entry(appointment).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(appointment)); }
public virtual void Update(T entity) { dbset.Attach(entity); dataContext.Entry(entity).State = EntityState.Modified; }