Exemple #1
0
        /// <summary>
        /// Deletes an email account
        /// </summary>
        /// <param name="emailAccount">Email account</param>
        public virtual void DeleteEmailAccount(EmailAccount emailAccount)
        {
            if (emailAccount == null)
            {
                throw new ArgumentNullException("emailAccount");
            }

            if (GetAllEmailAccounts().Count == 1)
            {
                throw new Exception("You cannot delete this email account. At least one account is required.");
            }

            _emailAccountRepository.Delete(emailAccount);
        }