public async Task <IActionResult> Create([Bind("ID,Name")] Artist artist) { if (ModelState.IsValid) { _context.Add(artist); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(artist)); }
public async Task <IActionResult> Create([Bind("ID,TrackID,PlaylistID")] TrackPlaylistMapping trackPlaylistMapping) { if (ModelState.IsValid) { _context.Add(trackPlaylistMapping); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(trackPlaylistMapping)); }
public async Task <IActionResult> Create([Bind("ID,ArtistID,Title,Length")] MusicTrack musicTrack) { if (ModelState.IsValid) { _context.Add(musicTrack); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(musicTrack)); }