public IActionResult RemoveBandFromConcert(BandConcert model) { //_context.BandConcert.Remove(_context.BandConcert.Single(x => x.BandID == bandId && x.ConcertID == concertId)); // delete from the linking table aswell _context.BandConcert.Remove(model); _context.SaveChanges(); return(RedirectToAction("Index")); }
public IActionResult AddBandToConcert(BandConcert model) { _context.BandConcert.Add(model); _context.SaveChanges(); return(RedirectToAction("Index")); }