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)); }
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)); }