Пример #1
0
 public ActionResult <Client> DeleteClient(int id)
 {
     try
     {
         var client = _repo.DeleteClientById(id);
         if (client != null && _repo.SaveAll())
         {
             return(Accepted(_mapper.Map <Client, ClientEntityModel>(client)));
         }
         return(NotFound());
     }
     catch (Exception e)
     {
         _logger.LogError($"Failed to delete client with id {id} : {e}");
         return(BadRequest(($"Failed to delete client with id {id}")));
     }
 }