public int Execute(Patient patient)
 {
     using (var dbConnection = new SqlConnection(conn.ConnectString))
     {
         dbConnection.Open();
         return (int)dbConnection.Query<decimal>(@"INSERT INTO PATIENT(FirstName,LastName)VALUES(@FirstName,@LastName); select SCOPE_IDENTITY();",
             new { FirstName = patient.FirstName, LastName = patient.LastName }).First();
     }
 }
        public void Execute(Patient patient)
        {
            using (var dbConnection = new SqlConnection(conn.ConnectString))
            {
                dbConnection.Open();
                dbConnection.Execute(@"UPDATE PATIENT SET FirstName=@FirstName, LastName=@LastName WHERE PatientID=@PatientID;",
                    new { PatientID = patient.PatientID, FirstName = patient.FirstName, LastName = patient.LastName });
            }

            dataCache.Invalidate(patient.GetCacheKey());
        }
 // PUT /api/values/5
 public UpdatePatientResult Update(Patient patient)
 {
     return handler.Get<UpdatePatientHandler, UpdatePatientResult>(new { Patient = patient });
 }
 // POST /api/values
 public CreatePatientResult Create(Patient patient)
 {
     return handler.Get<CreatePatientHandler,CreatePatientResult>(new { Patient = patient });
 }
 public ActionResult UpdateAction(Patient patient)
 {
     handler.Get<UpdatePatientHandler, UpdatePatientResult>(new { Patient = patient });
     return RedirectToAction("Read", "Patient", new { ID = patient.PatientID });
 }
 public ActionResult CreateAction(Patient patient)
 {
     var newPatient = handler.Get<CreatePatientHandler, CreatePatientResult>(new { Patient = patient });
     return RedirectToAction("Read", "Patient", new { ID = newPatient.PatientID });
 }
 public void Execute(Patient patient)
 {
 }