示例#1
0
        // 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));
        }
示例#3
0
        // GET: BookController
        public ActionResult Index()
        {
            var books = bookRepository.List();

            return(View(books));
        }