Beispiel #1
0
        public Response <List <Proveedor> > GetAll()
        {
            Response <List <Proveedor> > response = new Response <List <Proveedor> >();

            try
            {
                response.Value = proveedorRepository.GetAll();
                return(response);
            }
            catch (Exception e)
            {
                return(response.Error(e.Message));
            }
        }
                                                       [HttpGet] public async Task <IHttpActionResult> GetAll()
                                                       {
                                                           try {
                                                               var entities = await _entityRepo.GetAll();

                                                               /*var products = await _productRepo.GetAll();
                                                                * var obj = new {message= "resultado OK", employees = entities, products = products};
                                                                * //return Ok(obj);*/
                                                               return(Ok(entities));
                                                           }
                                                           catch (Exception e) { log.Error(new MDCSet(this.ControllerContext.RouteData), e);

                                                                                 return(InternalServerError(e)); }
                                                       }