public void CreateArtist(Artist artist) { if (artist == null) { throw new ArgumentNullException(nameof(artist)); } _context.Add(artist); }
public async Task <IActionResult> Create([Bind("BandId,CategoryId,BandName")] Bands bands) { if (ModelState.IsValid) { _context.Add(bands); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(bands)); }
public async Task <IActionResult> Create([Bind("SongId,ArtistId,BandId,CategoryId,ArtistName,timeDuration,Popularity,Price")] Song song) { if (ModelState.IsValid) { _context.Add(song); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(song)); }
public async Task <IActionResult> Create([Bind("ArtistId,BandId,ArtistName")] Artist artist) { if (ModelState.IsValid) { _context.Add(artist); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(artist)); }
public IActionResult Save(Products product) { if (product.Id > 0) { _musicStoreContext.Update(product); } else { _musicStoreContext.Add(product); } _musicStoreContext.SaveChanges(); return(RedirectToAction("Edit", new { id = product.Id })); }
public Genre Add(Genre newGenre) { _context.Add(newGenre); _context.SaveChanges(); return(newGenre); }
public Artist Add(Artist newArtist) { _context.Add(newArtist); _context.SaveChanges(); return(newArtist); }
public Album Add(Album newAlbum) { _context.Add(newAlbum); _context.SaveChanges(); return(newAlbum); }