public IHttpActionResult Delete(String id, Appointment a) { var req = sp.GetMany().Where(b => b.AppointmentId.Equals(id)).FirstOrDefault(); sp.Delete(req); sp.Commit(); return(Ok()); }
public ActionResult Delete(int id, Appointment ap) { try { var req = SA.GetMany().Where(a => a.AppointmentId.Equals(id)).FirstOrDefault(); SA.Delete(req); SA.Commit(); return(RedirectToAction("Index")); } catch { return(View()); } }