예제 #1
0
        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"));
        }
예제 #2
0
 public IActionResult AddBandToConcert(BandConcert model)
 {
     _context.BandConcert.Add(model);
     _context.SaveChanges();
     return(RedirectToAction("Index"));
 }