当前位置: 首页>>代码示例>>C#>>正文


C# IServiceProvider.?.GetLogger方法代码示例

本文整理汇总了C#中IServiceProvider.?.GetLogger方法的典型用法代码示例。如果您正苦于以下问题:C# IServiceProvider.?.GetLogger方法的具体用法?C# IServiceProvider.?.GetLogger怎么用?C# IServiceProvider.?.GetLogger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IServiceProvider的用法示例。


在下文中一共展示了IServiceProvider.?.GetLogger方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EphemeralXmlRepository

 public EphemeralXmlRepository(IServiceProvider services)
 {
     var logger = services?.GetLogger<EphemeralXmlRepository>();
     if (logger.IsWarningLevelEnabled())
     {
         logger.LogWarning("Using an in-memory repository. Keys will not be persisted to storage.");
     }
 }
开发者ID:hishamco,项目名称:DataProtection,代码行数:8,代码来源:EphemeralXmlRepository.cs

示例2: KeyRingProvider

 public KeyRingProvider(IKeyManager keyManager, KeyManagementOptions keyManagementOptions, IServiceProvider services)
 {
     _keyManagementOptions = new KeyManagementOptions(keyManagementOptions); // clone so new instance is immutable
     _keyManager = keyManager;
     _cacheableKeyRingProvider = services?.GetService<ICacheableKeyRingProvider>() ?? this;
     _logger = services?.GetLogger<KeyRingProvider>();
     _defaultKeyResolver = services?.GetService<IDefaultKeyResolver>()
         ?? new DefaultKeyResolver(_keyManagementOptions.KeyPropagationWindow, _keyManagementOptions.MaxServerClockSkew, services);
 }
开发者ID:yonglehou,项目名称:DataProtection,代码行数:9,代码来源:KeyRingProvider.cs

示例3: FileSystemXmlRepository

        /// <summary>
        /// Creates a <see cref="FileSystemXmlRepository"/> with keys stored at the given directory.
        /// </summary>
        /// <param name="directory">The directory in which to persist key material.</param>
        /// <param name="services">An optional <see cref="IServiceProvider"/> to provide ancillary services.</param>
        public FileSystemXmlRepository(DirectoryInfo directory, IServiceProvider services)
        {
            if (directory == null)
            {
                throw new ArgumentNullException(nameof(directory));
            }

            Directory = directory;
            Services = services;
            _logger = services?.GetLogger<FileSystemXmlRepository>();
        }
开发者ID:leloulight,项目名称:DataProtection,代码行数:16,代码来源:FileSystemXmlRepository.cs

示例4: RegistryXmlRepository

        /// <summary>
        /// Creates a <see cref="RegistryXmlRepository"/> with keys stored in the given registry key.
        /// </summary>
        /// <param name="registryKey">The registry key in which to persist key material.</param>
        /// <param name="services">The <see cref="IServiceProvider"/> used to resolve services.</param>
        public RegistryXmlRepository(RegistryKey registryKey, IServiceProvider services)
        {
            if (registryKey == null)
            {
                throw new ArgumentNullException(nameof(registryKey));
            }

            RegistryKey = registryKey;
            Services = services;
            _logger = services?.GetLogger<RegistryXmlRepository>();
        }
开发者ID:yonglehou,项目名称:DataProtection,代码行数:16,代码来源:RegistryXmlRepository.cs

示例5: EphemeralXmlRepository

 public EphemeralXmlRepository(IServiceProvider services)
 {
     var logger = services?.GetLogger<EphemeralXmlRepository>();
     logger?.UsingInmemoryRepository();
 }
开发者ID:yonglehou,项目名称:DataProtection,代码行数:5,代码来源:EphemeralXmlRepository.cs

示例6: FileSystemXmlRepository

 /// <summary>
 /// Creates a <see cref="FileSystemXmlRepository"/> with keys stored at the given directory.
 /// </summary>
 /// <param name="directory">The directory in which to persist key material.</param>
 /// <param name="services">An optional <see cref="IServiceProvider"/> to provide ancillary services.</param>
 public FileSystemXmlRepository([NotNull] DirectoryInfo directory, IServiceProvider services)
 {
     Directory = directory;
     Services = services;
     _logger = services?.GetLogger<FileSystemXmlRepository>();
 }
开发者ID:hishamco,项目名称:DataProtection,代码行数:11,代码来源:FileSystemXmlRepository.cs

示例7: RegistryXmlRepository

 /// <summary>
 /// Creates a <see cref="RegistryXmlRepository"/> with keys stored in the given registry key.
 /// </summary>
 /// <param name="registryKey">The registry key in which to persist key material.</param>
 public RegistryXmlRepository([NotNull] RegistryKey registryKey, IServiceProvider services)
 {
     RegistryKey = registryKey;
     Services = services;
     _logger = services?.GetLogger<RegistryXmlRepository>();
 }
开发者ID:hishamco,项目名称:DataProtection,代码行数:10,代码来源:RegistryXmlRepository.cs


注:本文中的IServiceProvider.?.GetLogger方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。