public IHttpActionResult GetPaymentDetails(int client_id) { try { using (MaxDbEntities db = new MaxDbEntities()) { var paymentDetails = db.ClientPayments(client_id).ToList(); return(Content(HttpStatusCode.OK, new { paymentDetails })); } } catch (Exception ex) { new Error().logAPIError(System.Reflection.MethodBase.GetCurrentMethod().Name, ex.ToString(), ex.StackTrace); return(InternalServerError()); } }