// Retrieve public IHttpActionResult Get() { apiResp = new ApiResponse(); var mng = new CoreAPI.ClienteManager(); apiResp.Data = mng.RetrieveAll(); return(Ok(apiResp)); }
// DELETE == public IHttpActionResult Delete(Cliente cliente) { try { var mng = new CoreAPI.ClienteManager(); mng.Delete(cliente); apiResp = new ApiResponse(); apiResp.Message = "Action was executed."; return(Ok(apiResp)); } catch (Exceptions.BussinessException bex) { return(InternalServerError(new Exception(bex.ExceptionId + "-" + bex.AppMessage.Message))); } }
// GET api/cliente/ // Retrieve by id public IHttpActionResult Get(string id) { try { var mng = new CoreAPI.ClienteManager(); var cliente = new Cliente { cedula = id }; cliente = mng.RetrieveById(cliente); apiResp = new ApiResponse(); apiResp.Data = cliente; return(Ok(apiResp)); } catch (Exceptions.BussinessException bex) { return(InternalServerError(new Exception(bex.ExceptionId + "-" + bex.AppMessage.Message))); } }