Beispiel #1
0
        public IHttpActionResult GetBook(int id)
        {
            Book book = service.Fetch(id);

            if (book == null)
            {
                return(NotFound());
            }
            return(Json(book.JsonReady()));
        }
Beispiel #2
0
        public Book Fetch(int id)
        {
            var book = sql.Fetch(id);

            if (book != null)
            {
                return(book);
            }
            else
            {
                book = api.Fetch(id);
                if (book != null)
                {
                    return(book);
                }
            }

            return(null);
        }