Пример #1
0
 public HttpResponseMessage GetAll()
 {
     try
     {
         return(Request.CreateResponse(HttpStatusCode.OK, appService.ConsultarTodos()));
     }
     catch (Exception ex)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message));
     }
 }
Пример #2
0
        public HttpResponseMessage GetAll()
        {
            try
            {
                var lista = appService.ConsultarTodos();

                return(Request.CreateResponse(HttpStatusCode.OK, lista));
            }
            catch (Exception e)
            {
                return(Request.CreateResponse(HttpStatusCode.InternalServerError, e.Message));
            }
        }