public async Task <ActionResult> GetCostCenters()
 {
     try
     {
         return(Ok(await costCenterRepository.GetCostCenters()));
     }
     catch (Exception)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError,
                           "Error retrieving data from database"));
     }
 }
Example #2
0
 public async Task <ActionResult> GetCostCenters()
 {
     try
     {
         return(Ok(await costcenterRepository.GetCostCenters()));
     }
     catch (DbUpdateException Ex)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError,
                           Ex.InnerException.Message));
     }
 }