public IActionResult Delete(int id,
                             [FromServices] IClienteApplicationService clienteApplicationService)
 {
     try
     {
         clienteApplicationService.Delete(id);
         return(Ok("Cliente Excluído com sucesso."));
     }
     catch (Exception e)
     {
         return(StatusCode(500, e.Message));
     }
 }
Exemple #2
0
        public IActionResult Delete(Guid id)
        {
            try
            {
                var clienteDTO = _clienteApplicationService.Delete(id);

                return(StatusCode(200, new
                {
                    Message = "Aluno excluído com sucesso.",
                    Cliente = clienteDTO
                }));
            }
            catch (Exception e)
            {
                return(StatusCode(500, new { e.Message }));
            }
        }