Esempio n. 1
0
        public DomainService(IBrandviserData brandviserData, IDomainFactory domainFactory,
                             IDateTimeProvider dateTimeProvider, IWhois whois, ITxtRecordsChecker txtRecordsChecker)
        {
            Guard.WhenArgument(brandviserData, nameof(IBrandviserData)).IsNull().Throw();
            Guard.WhenArgument(domainFactory, nameof(IDomainFactory)).IsNull().Throw();
            Guard.WhenArgument(dateTimeProvider, nameof(IDateTimeProvider)).IsNull().Throw();
            Guard.WhenArgument(whois, nameof(IWhois)).IsNull().Throw();
            Guard.WhenArgument(txtRecordsChecker, nameof(ITxtRecordsChecker)).IsNull().Throw();


            this.domainFactory     = domainFactory;
            this.brandviserData    = brandviserData;
            this.dateTimeProvider  = dateTimeProvider;
            this.whois             = whois;
            this.txtRecordsChecker = txtRecordsChecker;
        }
        public static MailerMessage AppendWhois(this MailerMessage mailerMessage, IWhois whoisService, string ipAddress)
        {
            try
            {
                mailerMessage.Body += string.Format("\n\n----------\n IP Address: {0}", ipAddress);

                var whois = whoisService.WhoisXml(ipAddress);
                if (whois.RegistryData.Registrant != null)
                {
                    mailerMessage.Body += string.Format("\n Organization: {0}\n Country: {1}\n", whois.RegistryData.Registrant.Name, whois.RegistryData.Registrant.Country);
                }
            }
            catch
            {
            }
            return mailerMessage;

        }
 public ContactController(IWhois whoisService, IMailer mailer)
 {
     this.whoisService = whoisService;
     this.mailer = mailer;
 }
 public GreetingController(IWhois whoisService)
 {
     this.whoisService = whoisService;
 }