public IActionResult Get(long id)
        {
            var book = _bookBusiness.FindByID(id);

            if (book == null)
            {
                return(NotFound());
            }
            return(Ok(book));
        }
Пример #2
0
        public Purchase Parse(PurchaseVO origin)
        {
            if (origin == null)
            {
                return(null);
            }

            return(new Purchase
            {
                Id = origin.Id,
                Address = origin.Address,
                Email = origin.Email,
                Smartphone = origin.Smartphone,
                //   User = _repository.FindById(origin.idUser).Username,
                Book = _bookBusiness.FindByID(origin.idBook),
                idBook = origin.idBook,
                idUser = origin.idUser
            });
        }
        public IActionResult Get(long id)
        {
            var person = _bookBusiness.FindByID(id);

            if (person == null)
            {
                return(NotFound());
            }
            return(Ok(person));
        }
Пример #4
0
        [HttpGet("{id}")] // Busca Individual

        public IActionResult Get(long id)
        {
            var book = _bookBusiness.FindByID(id);

            if (book == null)
            {
                return(NotFound("Não encontramos! Tente um ID valido"));
            }
            return(Ok(book));
        }
        public IActionResult FindByIDGet(long id)
        {
            var result = _bookBusiness.FindByID(id);

            if (result == null)
            {
                return(NotFound());
            }
            return(Ok(result));
        }
Пример #6
0
        public IActionResult Get([FromRoute] long id)
        {
            var book = _bookBusiness.FindByID(id);

            if (book == null)
            {
                return(BadRequest("Couldn't find this book"));
            }

            Book livro = new Book();

            livro = _bookRepository.GetInfoOneBook(book);

            if (livro == null)
            {
                return(BadRequest("Could not insert new information for this ISBN"));
            }

            return(Ok(livro));
        }