public ActionResult Get(long id)
        {
            var resultado = _bookBusiness.FindById(id);

            if (resultado == null)
            {
                return(NotFound());
            }
            return(Ok(resultado));
        }
Example #2
0
        public IActionResult Get(long id)
        {
            var book = _business.FindById(id);

            if (book?.Id == null)
            {
                return(NotFound($"Book with id {id} not found"));
            }

            return(Ok(book));
        }
        public IActionResult Get(long id)
        {
            var book = _bookBusiness.FindById(id);

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

            return(Ok(book));
        }
        public ActionResult <string> Get(int id)
        {
            var book = _bookBusiness.FindById(id);

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

            return(Ok(_bookBusiness.FindById(id)));
        }
Example #5
0
 public IActionResult GetBook(int id)
 {
     return(Ok(GetUrl.GerarLinks(
                   _bookBusiness.FindById(id),
                   nameof(GetBook),
                   this.HttpContext, _linkGenerator)));
 }
        public IActionResult Get(long id)
        {
            var person = _bookBusiness.FindById(id);

            if (person == null)
            {
                return(NotFound());
            }
            return(Ok(person));
        }
        public IActionResult Get(int id)
        {
            var person = _bookBusiness.FindById(id);
            if (person == null)
            {
                return NotFound();
            }

            return Ok(person);
        }
Example #8
0
        public ActionResult Get(int id)
        {
            BookVO book = _booksBusiness.FindById(id);

            if (book == null)
            {
                return(NotFound());
            }
            return(Ok(book));
        }
Example #9
0
        public IActionResult GetId(long id)
        {
            var result = _bookBusiness.FindById(id);

            if (result == null)
            {
                return(BadRequest("Livro não encontrado com o ID: " + id));
            }
            return(Ok(result));
        }
Example #10
0
        public ActionResult <string> Get(long id)
        {
            var book = _bookBusiness.FindById(id);

            if (book == null)
            {
                return(NoContent());
            }
            return(Ok(book));
        }
Example #11
0
        public IActionResult Get(long id)
        {
            var books = _bookBusiness.FindById(id);

            if (books == null)
            {
                return(NotFound());
            }
            return(new OkObjectResult(books));
        }
Example #12
0
 public IActionResult Get(int id)
 {
     try
     {
         return(Ok(_converter.Parse(_bookBusiness.FindById(id))));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #13
0
        public IActionResult Get(long id, [FromServices] IBookBusiness bookBusiness, [FromServices] IMapper mapper)
        {
            var resultDomain = bookBusiness.FindById(id);

            if (resultDomain != null)
            {
                return(Ok(mapper.Map <BookValue>(resultDomain)));
            }
            else
            {
                return(NotFound());
            }
        }
 public IActionResult Get(int id)
 {
     try
     {
         if (id != null)
         {
             return(Ok(_bookBusiness.FindById(id)));
         }
         else
         {
             return(NotFound());
         }
     }
     catch (Exception)
     {
         return(BadRequest());
     }
 }
Example #15
0
 public IActionResult GetByID(long id)
 {
     return(Ok(_business.FindById(id)));
 }
 public IActionResult Get(int id)
 {
     return(Ok(_bookBusiness.FindById(id)));
 }