Exemplo n.º 1
0
 public HttpResponseMessage GetAll()
 {
     try
     {
         ItemsResponse <TestDatesModel> resp = new ItemsResponse <TestDatesModel>();
         ScraperService svc = new ScraperService();
         resp.Items = svc.GetAll();
         return(Request.CreateResponse(HttpStatusCode.OK, resp));
     }
     catch (Exception e)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, e.Message));
     }
 }
Exemplo n.º 2
0
        public HttpResponseMessage GetAll()
        {
            try
            {
                ItemResponse <ScraperList> resp = new ItemResponse <ScraperList>();
                ScraperService             svc  = new ScraperService();

                resp.Item = svc.GetAll();
                return(Request.CreateResponse(HttpStatusCode.OK, resp));
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex.Message));
            }
        }