/// <summary> /// Initializes a new instance of the <see cref="SubscriptionLookupService"/> class. /// </summary> /// <param name="usersDal"> /// The users dal. /// </param> /// <param name="serviceSettings">the lookup service settings</param> public SubscriptionLookupService(IUsersDal usersDal, LookupServiceSettings serviceSettings) { Log.Info("Instantiating the Subscription Lookup Service"); if (serviceSettings == null) { throw new ArgumentNullException("serviceSettings"); } if (string.IsNullOrEmpty(serviceSettings.PublicationDescription) || string.IsNullOrEmpty(serviceSettings.PublicationId) || string.IsNullOrEmpty(serviceSettings.PublicationName) || string.IsNullOrEmpty(serviceSettings.PublicationOptinLink)) { throw new ArgumentException("one or more of the parameter properties have invalid value", "serviceSettings"); } this.usersDal = usersDal; this.serviceSettings = serviceSettings; _emailSubscribers = new List <string>(); Log.Info("Creating the Background worker to refresh the in memory email subscribers list every {0} minute(s) from db", RefreshIntervalInMinutes); Worker worker = new Worker(new RefreshWorkItem(this), 1000 * 60 * RefreshIntervalInMinutes); worker.StartWorker(); }
/// <summary> /// Initializes a new instance of the <see cref="LookupServiceInstanceProvider"/> class. /// </summary> /// <param name="usersDal"> /// The users dal. /// </param> /// <param name="lookupServiceSettings"> /// The lookup service settings. /// </param> public LookupServiceInstanceProvider(IUsersDal usersDal, LookupServiceSettings lookupServiceSettings) { if (usersDal == null) { throw new ArgumentNullException("usersDal"); } if (lookupServiceSettings == null) { throw new ArgumentNullException("lookupServiceSettings"); } this.usersDal = usersDal; this.lookupServiceSettings = lookupServiceSettings; }