// GET: Albums/Create public ActionResult Create() { var addForm = new AlbumAddForm(); addForm.ArtistId = new SelectList(m.AllArtistsList(), "Id", "Name"); addForm.Genre = new SelectList(m.AllGenres()); addForm.ReleaseDate = DateTime.Now.AddYears(-1); return(View(addForm)); }
// GET: Albums/Create public ActionResult Create() { // Create and configure an 'add form' var addForm = new AlbumAddForm(); // Fetch for and configure the artist listbox addForm.ArtistId = new SelectList(m.AllArtistsList(), "Id", "Name"); // Fetch and configure the genres addForm.Genre = new SelectList(m.AllGenres()); // Set a reasonable date addForm.ReleaseDate = DateTime.Now; return View(addForm); }