public ViewResult Create() { ViewBag.Types = new SelectList(_typeService.GetAllTypes(), "Id", "Name"); ViewBag.Genres = new MultiSelectList(_genreService.GetAllGenres(), "Id", "Name"); ViewBag.Languages = new SelectList(_languageService.GetAllLanguages(), "Id", "Description"); var authors = _authorService.GetAllAuthors().Select(author => new AuthorViewModel { Id = author.Id, FullName = author.Id + "-" + author.FirstName + " " + author.LastName }); ViewBag.Authors = new SelectList(authors, "Id", "FullName"); return(View()); }
// GET: Type public ActionResult Index() { var userId = Guid.Parse(User.Identity.GetUserId()); var service = new TypeService(userId); var model = service.GetAllTypes(); return(View(model)); }
// GET: Type public ActionResult Index() { var types = _typeService.GetAllTypes(); return(View(types)); }