Example #1
0
        public SeeAddedBooks TypeBooks(string type)
        {
            var model = new SeeAddedBooks {
                BooksToReadUser = GetAllBooks().Where(b => b.Type == type).ToList()
            };

            return(model);
        }
Example #2
0
        public SeeAddedBooks SeeAddedBooks(string userId)
        {
            var books = _databaseService.BooksToReadUser.Where(user => user.Id == userId);

            List <Book> booksToReadUser = new List <Book>();

            foreach (var b in books)
            {
                Book book = _databaseService.Books.Find(b.BookId);
                booksToReadUser.Add(book);
            }

            var model = new SeeAddedBooks {
                BooksToReadUser = booksToReadUser.ToList()
            };

            return(model);
        }