public async Task <HostDto> GetAsync(Guid id) { var host = await _hostsRepository.GetAsync(id); return(host is null ? null : Map(host)); }
public async Task AddAsync(CreateConferenceDto dto) { var host = await _hostsRepository.GetAsync(dto.HostId); if (host is null) { throw new HostNotFoundException(dto.HostId); } var conference = new Conference(dto.Name, dto.Location, dto.LogoUrl, dto.ParticipantsLimit, dto.From, dto.To, host); _conferenceRepository.Add(conference); await _conferenceRepository.UnitOfWork.SaveChangesAsync(); }