// Method to add Default unSelect value for authors List <Author> FillSelectList() { var authors = authorRepository.List().ToList(); authors.Insert(0, new Author { Id = -1, FullName = "---- Please Select an author ---" }); return(authors); }
// GET: HomeController public ActionResult Index() { var authors = authorRepository.List(); return(View(authors)); }
// GET: BookController public ActionResult Index() { var books = bookRepository.List(); return(View(books)); }