public override void Default(ScheduledRenewal renewal, IOptionsService optionsService) { var siteId = optionsService.TryGetLong(nameof(optionsService.Options.FtpSiteId), optionsService.Options.FtpSiteId) ?? optionsService.TryGetLong(nameof(optionsService.Options.InstallationSiteId), optionsService.Options.InstallationSiteId) ?? optionsService.TryGetLong(nameof(optionsService.Options.SiteId), optionsService.Options.SiteId) ?? throw new Exception($"Missing parameter --{nameof(optionsService.Options.FtpSiteId).ToLower()}"); var site = _iisClient.GetFtpSite(siteId); renewal.Binding.FtpSiteId = site.Id; }
public override void Default(ScheduledRenewal renewal, IOptionsService optionsService) { var installationSiteId = optionsService.TryGetLong(nameof(optionsService.Options.InstallationSiteId), optionsService.Options.InstallationSiteId); if (installationSiteId != null) { var site = _iisClient.GetFtpSite(installationSiteId.Value); // Throws exception when not found renewal.Binding.InstallationSiteId = site.Id; } else { throw new Exception($"Missing parameter --{nameof(optionsService.Options.InstallationSiteId).ToLower()}"); } }