コード例 #1
0
 public void VerwijderInschrijving(Inschrijving inschrijving)
 {
     if (Inschrijvingen.Any(i => i.Gebruiker == inschrijving.Gebruiker))
     {
         Inschrijvingen.Remove(inschrijving);
     }
 }
コード例 #2
0
 public void VoegInschrijvingToe(Gebruiker gebruiker)
 {
     if (Inschrijvingen.Count < Maxplaatsen && gebruiker.Status == GebruikerStatus.ACTIEF)
     {
         if (Inschrijvingen.Any(i => i.Gebruiker == gebruiker))
         {
             throw new ArgumentException($"{gebruiker.Naam} is reeds ingeschreven voor deze sessie");
         }
         Inschrijving inschrijving = new Inschrijving(gebruiker, this, DateTime.Now);
         Inschrijvingen.Add(inschrijving);
     }
     else
     {
         throw new InvalidOperationException();
     }
 }