Example #1
0
        public async Task CreateConference(ConferenceInfo conference)
        {
            if (await _conferenceRepository.CheckExistenceBySlug(conference.Slug))
            {
                throw new DuplicateNameException("The chosen conference slug is already taken.");
            }

            // Conference publishing is explicit.
            if (conference.IsPublished)
            {
                conference.IsPublished = false;
            }

            await _conferenceRepository.Create(conference);

            _hostServiceBus.Publish <IConferenceCreated>(new ConferenceCreated(conference));
        }