public IHttpActionResult Get(Credit credit) { var mng = new CreditManager(); List <Credit> accounList = mng.RetrieveById(credit); if (accounList == null) { return(Content(HttpStatusCode.NotFound, "Not found")); } return(Ok(accounList)); }
// GET api/credit/5 // Retrieve by id public IHttpActionResult Get(int id) { try { var mng = new CreditManager(); var credit = new Credit { Id = id }; credit = mng.RetrieveById(credit); apiResp = new ApiResponse(); apiResp.Data = credit; return(Ok(apiResp)); } catch (BussinessException bex) { return(InternalServerError(new Exception(bex.ExceptionId + "-" + bex.AppMessage.Message))); } }