Exemplo n.º 1
0
 public HttpResponseMessage Get(int id)
 {
     try
     {
         var data = new DebtCoverBL().GetDebtCover(id);
         return(Request.CreateResponse(HttpStatusCode.OK, data));
     }
     catch (Exception ex)
     {
         LogManager.Instance.Error(ex);
         return(Request.CreateResponse(HttpStatusCode.InternalServerError));
     }
 }
Exemplo n.º 2
0
 public HttpResponseMessage Get(string query)
 {
     try
     {
         var cmd        = JsonConvert.DeserializeObject <PaginationDTO>(query);
         int pagesCount = 0;
         var data       = new DebtCoverBL().GetDebtCovers(cmd, ref pagesCount);
         var result     = Request.CreateResponse(HttpStatusCode.OK, data);
         result.Headers.Add(Consts.PAGES_COUNT, pagesCount.ToString());
         return(result);
     }
     catch (Exception ex)
     {
         LogManager.Instance.Error(ex);
         return(Request.CreateResponse(HttpStatusCode.InternalServerError));
     }
 }