示例#1
0
        public IHttpActionResult GetBookByID(int id)
        {
            Book Book = BookData.GetBook(id);

            //En caso de no encontrar un libro con dicho id, retorna un BadRequest
            if (Book == null)
            {
                return(BadRequest());
            }
            return(Ok(Book));
        }
示例#2
0
    public WCFBook GetBook(string id)
    {
        Book b = BookData.GetBook(Int32.Parse(id));

        return(WCFBook.Make(b.BookID.ToString(), b.Title, b.ISBN, b.Author, b.Stock, b.Price));
    }
示例#3
0
 public List <Book> GetBook()
 {
     return(bookData.GetBook());
 }