コード例 #1
0
        public NotificationPublishProviderManager(
            IServiceProvider serviceProvider,
            IOptions <AbpNotificationOptions> options)
        {
            Options = options.Value;

            _lazyProviders = new Lazy <List <INotificationPublishProvider> >(
                () => Options
                .PublishProviders
                .Select(type => serviceProvider.GetRequiredService(type) as INotificationPublishProvider)
                .ToList(),
                true
                );
        }
コード例 #2
0
        public NotificationDefinitionManager(
            IOptions <AbpNotificationOptions> options,
            IServiceScopeFactory serviceScopeFactory)
        {
            _serviceScopeFactory = serviceScopeFactory;
            Options = options.Value;

            _lazyNotificationDefinitions = new Lazy <Dictionary <string, NotificationDefinition> >(
                CreateNotificationDefinitions,
                isThreadSafe: true
                );

            _lazyNotificationGroupDefinitions = new Lazy <Dictionary <string, NotificationGroupDefinition> >(
                CreateNotificationGroupDefinitions,
                isThreadSafe: true
                );
        }