Beispiel #1
0
        public ActionResult ShowAuthor(int id)
        {
            Dictionary <string, object> dictionary = new Dictionary <string, object> {
            };
            List <BookClass> books  = BookClass.GetBooksByAuthorId(id);
            AuthorClass      author = AuthorClass.GetAuthorById(id);

            dictionary.Add("books", books);
            dictionary.Add("author", author);
            return(View(dictionary));
        }
Beispiel #2
0
        public ActionResult SearchAuthor(string authorNameSearch)
        {
            AuthorClass author = AuthorClass.GetAuthorByName(authorNameSearch);
            int         id     = author.GetId();
            Dictionary <string, object> dictionary = new Dictionary <string, object> {
            };
            List <BookClass> books = BookClass.GetBooksByAuthorId(id);

            dictionary.Add("books", books);
            dictionary.Add("author", author);
            return(View("ShowAuthor", dictionary));
        }