Exemplo n.º 1
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));
        }
        public async Task <IEnumerable <Recommendation> > GetRecommendations()
        {
            ReadingListRepository <Recommendation> .Initialize();

            IEnumerable <Recommendation> recomms = (IEnumerable <Recommendation>) await ReadingListRepository <Recommendation> .GetBooks(d => d.type == "recommendation");

            return(recomms);
        }