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));
        }
 public async Task UpdateConference(ConferenceInfo conference) {
     if (!await _conferenceRepository.CheckExistenceById(conference.Id))
         throw new ApplicationException("Conference record wasn't found!");
     await _conferenceRepository.UpdateConference(conference);
 }
 public ConferenceCreated(ConferenceInfo conference) {
     CorrelationId = conference.Id;
     Name = conference.Name;
     Description = conference.Description;
     Location = conference.Location;
     Slug = conference.Slug;
     Tagline = conference.Tagline;
     TwitterSearch = conference.TwitterSearch;
     StartDate = conference.StartDate;
     EndDate = conference.EndDate;
     Owner = new Owner(conference.OwnerName, conference.OwnerEmail);
     Id = NewId.NextGuid();
     TimeStamp = DateTimeOffset.UtcNow;
     Version = 1;
 }