// POST: api/Default public IHttpActionResult Post(Patient patient) { try { var result = patientManager.AddPatient(Mapper.Map<Patient, PatientBlDto>(patient)); if(result.Status==Framework.Status.Failed) return InternalServerError(new Exception(string.Join(",",result.Messages))); return Ok<int>(result.returnObject.PatientId); } catch(Exception ex) { return InternalServerError(new Exception("couldn't save the data")); } }
// PUT: api/Default/5 public void Put(int id, Patient patient) { patientManager.UpdatePatient(Mapper.Map<Patient, PatientBlDto>(patient)); }