Exemple #1
0
        public void Create(User organizer, Institution institution, string name, DateTime beginDate, DateTime endDate, DateTime registrationAvaliable,
                           string mainPlaceName, Coordinates coordinates, string placeDescription = null)
        {
            var newEvent = new Event(name, beginDate, endDate, registrationAvaliable, mainPlaceName, coordinates, placeDescription, dateTimeProvider);

            var organizeruser = newEvent.RegisterOrganizer(organizer, institution);

            eventRepository.Create(newEvent);
            assistantRepository.Register(organizeruser);
        }
Exemple #2
0
        internal Organizer RegisterOrganizer(User user, Institution institution)
        {
            var partaker = new Organizer(user.ToString(), user.Email, institution, NextNumber);

            if (IsAlreadyRegistered(partaker))
            {
                throw new DomainException($"{user.ToString()} is already registered");
            }

            partakers.Add(partaker);
            return(partaker);
        }