public async Task <Band> InsertBandAsync(Band newBand) { _context.Bands.Add(newBand); await _context.SaveChangesAsync(); return(newBand); }
public async Task <Venue> InsertVenueAsync(Venue newVenue) { _context.Venues.Add(newVenue); await _context.SaveChangesAsync(); return(newVenue); }
public async Task <Concert> InsertConcertAsync(Concert newConcert, List <Band> bands) { bands.ForEach(b => { var concertBand = new ConcertBand { Band = _context.Bands.Find(b.Id), Concert = newConcert }; newConcert.ConcertBands.Add(concertBand); }); _context.Concerts.Add(newConcert); await _context.SaveChangesAsync(); return(newConcert); }