Beispiel #1
0
 public void RemoveGoing(Event @event)
 {
     if (!Goings.Any(ug => ug.EventId == @event.EventId))
     {
         throw new Exception("Event not in 'Going'");
     }
     else
     {
         UserGoing userGoing = Goings.SingleOrDefault(ug => ug.EventId == @event.EventId);
         Goings.Remove(userGoing);
     }
 }
Beispiel #2
0
 public void AddGoing(Event @event)
 {
     if (Goings.Any(ug => ug.EventId == @event.EventId))
     {
         throw new Exception("Event already in 'Going'");
     }
     else if (Interests.Any(ui => ui.EventId == @event.EventId))
     {
         UserInterested userInterested = Interests.SingleOrDefault(ui => ui.EventId == @event.EventId);
         Interests.Remove(userInterested);
         UserGoing userGoing = new UserGoing(this, @event);
         Goings.Add(userGoing);
     }
     else
     {
         UserGoing userGoing = new UserGoing(this, @event);
         Goings.Add(userGoing);
     }
 }