public async Task <IEnumerable <Book> > GetUsersBooks()
        {
            ReadingListRepository <Book> .Initialize();

            IEnumerable <Book> myBooks = (IEnumerable <Book>) await ReadingListRepository <Book> .GetBooksForUser(b => b.reader == Settings.readerName);

            return(myBooks);
        }
        public async Task <Book> GetBook(string id)
        {
            //get the requested record.
            ReadingListRepository <Book> .Initialize();

            IEnumerable <Book> myBooks = (IEnumerable <Book>) await ReadingListRepository <Book> .GetBooksForUser(b => b.id == id.ToString());

            return(myBooks.First());
        }
Exemple #3
0
        // GET: ReadingList
        public async Task <ActionResult> Index()
        {
            ReadingListViewModel readingListContent = new ReadingListViewModel();

            readingListContent.LibraryBooks = await ReadingListRepository <Recommendation> .GetBooks(d => d.type == "recommendation");

            ReadingListRepository <Book> .Initialize();

            readingListContent.MyBooks = (IEnumerable <Book>) await ReadingListRepository <Book> .GetBooksForUser(b => b.reader == Settings.readerName);

            return(View(readingListContent));
        }