Beispiel #1
0
 public bool GigChangedIsValid(Gig gig, InputModelGig input)
 {
     if (!(gig.Venue == input.Venue && gig.DateTime == input.DateTime && gig.GenreId == input.Genre))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Beispiel #2
0
        public void AddGig(string artistId, InputModelGig input)
        {
            var gig = new Gig
            {
                ArtistId = artistId,
                Venue    = input.Venue,
                DateTime = input.DateTime,
                GenreId  = input.Genre
            };

            _context.Gigs.Add(gig);
        }
Beispiel #3
0
 public void UpdateGig(Gig gig, InputModelGig input)
 {
     try
     {
         gig.Modify(input.Venue, input.DateTime, input.Genre);
         _context.Attach(gig).State = EntityState.Modified;
     }
     catch (Exception)
     {
         if (!_context.Gigs.Any(e => e.Id == gig.Id))
         {
             throw;
         }
     }
 }