public void UpdateOrganizer(Organizer organizer) { if (organizer != null && Organizer != organizer) { if (Organizer != null) { Organizer.RemoveEvent(this); } Organizer = organizer; organizer.AddEventToOrganizer(this); } }
public Event(string name, DateTime date, string description, int requiredPoints, ICollection <string> tags, Organizer organizer, Address address) : this() { Name = name; Date = date; Description = description; RequiredPoints = requiredPoints; Tags = tags; if (organizer == null) { throw new Exception("Organizer cannot be null"); } UpdateOrganizer(organizer); if (address == null) { throw new Exception("Address cannot be null"); } UpdateAddress(address); }