本文整理汇总了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);
}
示例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>();
}
}
示例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";
}
示例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);
}
示例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);
}
示例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);
}
示例7: LatestResearchService
public LatestResearchService(IConfigurationService configurationService, ObjectCache cache)
{
_configurationService = configurationService;
_cache = cache;
_token = _configurationService.GetSetting("Test", "LatestResearchToken", "Dictionaries", "AppSettings", "General");
}