예제 #1
0
 public IActionResult Get(int id)
 {
     try
     {
         Client objClient = _service.Get(id);
         objClient.Nit = Encripter.Decrypt(objClient.Nit);
         return(Ok(objClient));
     }
     catch (Exception ex)
     {
         logger.Error(ex.Message + " - " + ex.StackTrace);
         return(BadRequest());
     }
 }
예제 #2
0
 public IActionResult Get()
 {
     try
     {
         List <Client> lstClents = new List <Client>();
         foreach (var item in _service.Get())
         {
             item.Nit = Encripter.Decrypt(item.Nit);
             lstClents.Add(item);
         }
         return(Ok(lstClents));
     }
     catch (Exception ex)
     {
         logger.Error(ex.Message + " - " + ex.StackTrace);
         return(BadRequest());
     }
 }