Пример #1
0
 public IActionResult Delete(ClientDTO clientDto)
 {
     try
     {
         var client = clientDto.MapToClient();
         var result = client.Delete();
         return(Ok(result));
     }
     catch (Exception exception)
     {
         return(RedirectToAction("Error"));
     }
 }
Пример #2
0
 public IActionResult Delete([FromBody] ClientDTO clientDto)
 {
     try
     {
         var client = clientDto.MapToClient();
         var result = client.Delete();
         return(Ok(result));
     }
     catch (Exception exception)
     {
         return(NotFound());
     }
 }