using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using System; using System.Collections.Generic; using System.Linq; using Volo.Abp.DependencyInjection; namespace Sanhe.Abp.Notifications; public class NotificationPublishProviderManager : INotificationPublishProviderManager, ISingletonDependency { public List Providers => _lazyProviders.Value; protected AbpNotificationsOptions Options { get; } private readonly Lazy> _lazyProviders; public NotificationPublishProviderManager( IServiceProvider serviceProvider, IOptions optionsAccessor) { Options = optionsAccessor.Value; _lazyProviders = new Lazy>( () => Options .PublishProviders .Select(type => serviceProvider.GetRequiredService(type) as INotificationPublishProvider) .ToList(), true ); } }