Exemplo n.º 1
0
        public async Task CreateAsync(string email, string password, string SettingsHost, int SettingsPort)
        {
            var emailAccount = await _emailAccountRepository.GetByEmailAsync(email);

            var settings = await _settingsRepository.GetAsyncByPort(SettingsPort);

            if (emailAccount != null)
            {
                throw new Exception($"Client with E-Mail: '{email}' already exsist.");
            }
            if (settings == null)
            {
                settings = new Smtp(SettingsPort, SettingsHost);
            }
            emailAccount = new EmailAccount(email, password);
            await _emailAccountRepository.AddAsync(emailAccount);
        }
Exemplo n.º 2
0
        public async Task <SmtpDTO> GetAsyncByPort(int port)
        {
            var smtp = await _settingsRepository.GetAsyncByPort(port);

            return(_mapper.Map <SmtpDTO>(smtp));
        }
Exemplo n.º 3
0
        public async Task <IMapDTO> GetAsyncByPort(int port)
        {
            var iMap = await _settingsRepository.GetAsyncByPort(port);

            return(_mapper.Map <IMapDTO> (iMap));
        }