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


C# IConfigurationService.GetSetting方法代码示例

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


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

示例1: DirectoryConnectionConfig

 public DirectoryConnectionConfig(IConfigurationService configService)
 {
     this.ServerName = configService.GetSetting<string>("adLds:serverName", string.Empty);
     this.Port = configService.GetSetting<string>("adLds:port", string.Empty);
     this.Prefix = configService.GetSetting<string>("adLds:prefix", string.Empty);
     this.Container = configService.GetSetting<string>("adLds:container", string.Empty);
 }
开发者ID:ianlovell,项目名称:openidconnect,代码行数:7,代码来源:DirectoryConnectionConfig.cs

示例2: RegisterUserStore

        private static void RegisterUserStore(IConfigurationService configService, ContainerBuilder builder)
        {
            UserStoreType userStoreType;
            Enum.TryParse(configService.GetSetting("IdentityServerUserStore", "None"), out userStoreType);
            builder.Register(ctx => userStoreType);

            switch (userStoreType)
            {
                case UserStoreType.AspNetIdentity:
                    RegisterAspNetIdentity(builder);
                    break;
                case UserStoreType.MembershipReboot:
                    RegisterMembershipReboot(builder);
                    break;
                case UserStoreType.AdLds:
                    RegisterAdLds(builder);
                    break;
                case UserStoreType.UsersApi:
                    RegisterApiServices(configService, builder);
                    break;
                default:
                    throw new InvalidOperationException("Invalid user store type specified");
            }

            if (userStoreType != UserStoreType.UsersApi)
            {
                builder.RegisterType<DomainUserService>().As<IUserService>();
                builder.RegisterType<DomainIdentityManagerService>().As<IIdentityManagerService>();
            }
        }
开发者ID:JGaudion,项目名称:openidconnect,代码行数:30,代码来源:Modules.cs

示例3: NewsController

        public NewsController(IRssParserService rssParserService, INewsService newsService, IConfigurationService configurationService)
			: base(configurationService)
        {
            _rssParserService = rssParserService;
            _newsService = newsService;
            _useRssDataSource = configurationService.GetSetting(string.Empty, "NewsDataSource", "Dictionaries", "AppSettings", "General", "News").ToLower() == "rss";
        }
开发者ID:evkap,项目名称:MetaPortal,代码行数:7,代码来源:NewsController.cs

示例4: RegisterApiServices

        private static void RegisterApiServices(IConfigurationService configService, ContainerBuilder builder)
        {
            var usersApiUri = configService.GetSetting<string>("UsersApiUri", null);

            builder.RegisterType<UsersApiUserService>().As<IUserService>()
                .WithParameter("usersApiUri", usersApiUri);

            builder.RegisterType<UsersApiIdentityManagerService>().As<IIdentityManagerService>()
                .WithParameter("usersApiUri", usersApiUri);
        }
开发者ID:JGaudion,项目名称:openidconnect,代码行数:10,代码来源:Modules.cs

示例5: RegisterApiServices

        private static void RegisterApiServices(IConfigurationService configService, ContainerBuilder builder)
        {
            var usersApiUri = configService.GetSetting<string>("UsersApiUri", null);
            var identityServerUri = configService.GetSetting<string>("IdentityServerUri", null);

            builder.RegisterType<UsersApiUserService>().As<IUserService>()
                .WithParameter("usersApiUri", usersApiUri)
                .WithParameter("identityServerUri", identityServerUri);

            builder.RegisterType<X509SignedTokenProvider>()
                .WithParameter("cert", Cert.Load(typeof(IOwinBootstrapper).Assembly, "Cert", "idsrv3test.pfx", "idsrv3test"))
                .Named<ITokenProvider>("tokenProvider");

            builder.RegisterDecorator<ITokenProvider>(p => new CachingTokenProvider(p), "tokenProvider");

            builder.RegisterType<UsersApiIdentityManagerService>().As<IIdentityManagerService>()
                .WithParameter("usersApiUri", usersApiUri)
                .WithParameter("identityServerUri", identityServerUri);
        }
开发者ID:ianlovell,项目名称:openidconnect,代码行数:19,代码来源:Modules.cs

示例6: RegisterExternalIdentityProviders

        private static void RegisterExternalIdentityProviders(IConfigurationService configService, ContainerBuilder builder)
        {
            var externalIdentityProviderService = new ExternalIdentityProviderService()
                .WithGoogleAuthentication(configService.GetSetting("externalProviders:google:clientId", string.Empty), configService.GetSetting("externalProviders:google:clientSecret", string.Empty))
                .WithFacebookAuthentication(configService.GetSetting("externalProviders:facebook:clientId", string.Empty), configService.GetSetting("externalProviders:facebook:clientSecret", string.Empty))
                .WithTwitterAuthentication(configService.GetSetting("externalProviders:twitter:clientId", string.Empty), configService.GetSetting("externalProviders:twitter:clientSecret", string.Empty));

            builder.Register(ctx => externalIdentityProviderService);
        }
开发者ID:JGaudion,项目名称:openidconnect,代码行数:9,代码来源:Modules.cs

示例7: LatestResearchService

 public LatestResearchService(IConfigurationService configurationService, ObjectCache cache)
 {
     _configurationService = configurationService;
     _cache = cache;
     _token = _configurationService.GetSetting("Test", "LatestResearchToken", "Dictionaries", "AppSettings", "General");
 }
开发者ID:evkap,项目名称:MetaPortal,代码行数:6,代码来源:LatestResearchService.cs


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