示例#1
0
 public IEnumerable <President> GetAll()
 {
     try
     {
         return(_president.GetAll());
     }
     catch (Exception ex)
     {
         throw new Exception("PresidentController. Error en GetAll. Error:" + ex.Message);
     }
 }
示例#2
0
 public IActionResult Get()
 {
     try
     {
         IEnumerable <CustomerDto> customers = _customerService.GetAll();
         return(Ok(new ApiResponse <IEnumerable <CustomerDto> >(customers)));
     }
     catch (Exception ex)
     {
         return(Ok(new ApiResponse <string>(ex.Message)));
     }
 }