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));
        }
示例#3
0
        public IActionResult Get(long id)
        {
            var response = Ok(_personBusiness.FindById(id));

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

            return(response);
        }
示例#4
0
        public IActionResult Get(int id)
        {
            var person = _personService.FindById(id);

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

            return(NotFound(person));
        }
示例#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));
        }
示例#6
0
        public IActionResult Get(string id)
        {
            var person = _personRepository.FindById(id);

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

            if (person == null)
            {
                return(NotFound());
            }
            else
            {
                return(Ok(person));
            }
        }
示例#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());
            }
        }
示例#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);
 }
示例#12
0
 public IActionResult GetById(long id)
 {
     return(Ok(_personBusiness.FindById(id)));
 }