// GET: Books/Create public IActionResult Create() { ViewData["AuthorId"] = new SelectList(_iAuthorManager.GetAll(), "Id", "Name"); ViewData["BookCategoryId"] = new SelectList(_iBookCategoryManager.GetAll(), "Id", "Name"); ViewData["LanguageId"] = new SelectList(_iLanguageManager.GetAll(), "Id", "Name"); ViewData["PublisherId"] = new SelectList(_iPublisherManager.GetAll(), "Id", "Name"); return(View()); }
public void SetSessionPublishers() { var publishers_list = publisherManager.GetAll(); List <SelectListItem> listItems = new List <SelectListItem>(); foreach (var item in publishers_list) { listItems.Add(new SelectListItem { Text = item.Name, Value = item.PublisherId.ToString() }); } Session["Publishers"] = listItems; }
// GET: Publishers public IActionResult Index() { var publisher = _iPublisherManager.GetAll(); return(View(publisher)); }