Esempio n. 1
0
        public IActionResult Details(Guid id)
        {
            var cliente = _clienteApplicationService.GetById(id);

            if (cliente == null)
            {
                return(NotFound());
            }

            return(View(cliente));
        }
Esempio n. 2
0
        public ActionResult <string> Get(int id)
        {
            try
            {
                if (id == 0)
                {
                    return(NotFound());
                }

                var result = _clienteApplicationService.GetById(id);

                return(Ok(result));
            }
            catch (Exception ex)
            {
                return(this.StatusCode(StatusCodes.Status500InternalServerError, $"Banco Dados Falhou {ex.Message}"));
            }
        }
Esempio n. 3
0
 public IActionResult GetById(int id,
                              [FromServices] IClienteApplicationService clienteApplicationService)
 {
     try
     {
         return(Ok(clienteApplicationService.GetById(id)));
     }
     catch (Exception e)
     {
         return(StatusCode(500, e.Message));
     }
 }
Esempio n. 4
0
        public IActionResult GetById(long id)
        {
            try
            {
                var result = clienteApplicationService.GetById(id);

                return(Ok(result));
            }
            catch (Exception e)
            {
                return(StatusCode(500, e.Message));
            }
        }
 public ActionResult <string> Get(int id)
 {
     try
     {
         var cliente = _clienteApp.GetById(id);
         if (cliente == null)
         {
             return(NotFound());
         }
         return(Ok(cliente));
     }
     catch (Exception)
     {
         return(NotFound());
     }
 }
Esempio n. 6
0
        public IActionResult GetById(Guid id)
        {
            try
            {
                var alunoDTO = _clienteApplicationService.GetById(id);

                if (alunoDTO == null)
                {
                    return(StatusCode(204));
                }

                return(StatusCode(200, alunoDTO));
            }
            catch (Exception e)
            {
                return(StatusCode(500, new { e.Message }));
            }
        }