public IActionResult Create(Format format) { if (ModelState.IsValid) { _db.Add(format); _db.SaveChanges(); return(RedirectToAction(nameof(Index))); } return(View(format)); }
public IActionResult CreatePost() { if (!ModelState.IsValid) { AlbumVM.Artists = _db.Artists.ToList(); return(View(AlbumVM)); } _db.Add(AlbumVM.Album); _db.SaveChanges(); return(RedirectToAction(nameof(Index))); }