Beispiel #1
0
 private void EnsureAttendeeIsAttendingThisConference(Attendee attendee)
 {
     if (!IsAttending(attendee))
     {
         throw new NotAttendingConferenceException(attendee, this);
     }
 }
Beispiel #2
0
        public void SignUpForSession(Attendee attendee, int sessionId)
        {
            EnsureAttendeeIsAttendingThisConference(attendee);

             var session = FindSession(sessionId);

             session.Attend(attendee);
        }
Beispiel #3
0
 public void Attend(Attendee attendee)
 {
     EnsureSessionIsNotFull();
     Attendees.Add(attendee);
 }
Beispiel #4
0
 private bool IsAttending(Attendee attendee)
 {
     return Attendees.Contains(attendee);
 }
 /// <summary>
 /// Create a new Attendee object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 public static Attendee CreateAttendee(global::System.Int32 id, global::System.String name)
 {
     Attendee attendee = new Attendee();
     attendee.Id = id;
     attendee.Name = name;
     return attendee;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Attendees EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToAttendees(Attendee attendee)
 {
     base.AddObject("Attendees", attendee);
 }
 public NotAttendingConferenceException(Attendee attendee, Conference conference)
     : base(attendee.Name + " is not registered for the conference " + conference.Name)
 {
 }