Exemplo n.º 1
0
        public async Task <Band> InsertBandAsync(Band newBand)
        {
            _context.Bands.Add(newBand);
            await _context.SaveChangesAsync();

            return(newBand);
        }
Exemplo n.º 2
0
        public async Task <Venue> InsertVenueAsync(Venue newVenue)
        {
            _context.Venues.Add(newVenue);
            await _context.SaveChangesAsync();

            return(newVenue);
        }
Exemplo n.º 3
0
        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);
        }