Exemple #1
0
        public ActionResult Delete(int?id)
        {
            var db         = new BookstoreDb();
            var publishers = db.GetPublishers().Where(i => i.Id == id).FirstOrDefault();

            return(View(publishers));
        }
Exemple #2
0
        // GET: Book/Create
        public ActionResult Create()
        {
            var publishers = _db.GetPublishers();

            var list = new SelectList(publishers, "Id", "Name");

            return(View(list));
        }
Exemple #3
0
        // GET: Publisher
        // GET: Publisher
        public ActionResult Index()
        {
            var db = new BookstoreDb();

            var publishers = db.GetPublishers();

            return(View(publishers.ToList()));
        }
Exemple #4
0
        // GET: Publisher
        public ActionResult Index()
        {
            var db = new BookstoreDb();

            var publishers = db.GetPublishers();

            ViewBag.PageTitle = "Publisher list";

            return(View(publishers.ToList()));
        }