Exemplo n.º 1
0
        public IActionResult Get(int id)
        {
            var person = _personBusiness.FindById(id);

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

            return(Ok(person));
        }
        public ActionResult <string> Get(long id)
        {
            var person = _personBusiness.FindById(id);

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

            return(Ok(person));
        }
Exemplo n.º 3
0
        public IActionResult Get(long id)
        {
            var response = Ok(_personBusiness.FindById(id));

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

            return(response);
        }
Exemplo n.º 4
0
        public IActionResult Get(int id)
        {
            var person = _personService.FindById(id);

            if (person != null)
            {
                return(Ok(person));
            }

            return(NotFound(person));
        }
Exemplo n.º 5
0
        // public ActionResult<string> Get(int id)
        public IActionResult Get(long id)
        {
            // return "value";
            var person = _personBusiness.FindById(id);

            if (person == null)
            {
                return(NotFound());
            }
            return(Ok(person));
        }
Exemplo n.º 6
0
        public IActionResult Get(string id)
        {
            var person = _personRepository.FindById(id);

            if (person != null)
            {
                return(Ok(person));
            }
            else
            {
                return(BadRequest("Id not found"));
            }
        }
Exemplo n.º 7
0
        public IActionResult Get(long id)
        {
            var person = _personbusiness.FindById(id);

            if (person == null)
            {
                return(NotFound());
            }
            else
            {
                return(Ok(person));
            }
        }
Exemplo n.º 8
0
        public IActionResult Get(long id, [FromServices] IPersonBusiness personService, [FromServices] IMapper mapper)
        {
            var resultDomain = personService.FindById(id);

            if (resultDomain != null)
            {
                return(Ok(mapper.Map <PersonValue>(resultDomain)));
            }
            else
            {
                return(NotFound());
            }
        }
Exemplo n.º 9
0
        public IActionResult Get(int id)
        {
            try
            {
                var person = _personBusiness.FindById(id);
                if (person == null)
                {
                    return(NotFound());
                }

                return(Ok(person));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public Person FindById(long id)
 {
     return(_repository.FindById(id));
 }
 public IActionResult Get(int id)
 {
     var person = _personService.FindById(id);
     if (person == null) return NotFound();
     return Ok(person);
 }
Exemplo n.º 12
0
 public IActionResult GetById(long id)
 {
     return(Ok(_personBusiness.FindById(id)));
 }