public DocumentDbDataSource(string name, DocumentDbConnectionInfo connectionInfo) { Name = name; _databaseId = connectionInfo.DatabaseName; _key = connectionInfo.Key; _uri = connectionInfo.Uri; }
private static IConfigurationProvider CreateConfigurationProvider(IServiceProvider services) { var serviceContext = services.GetRequiredService <ServiceContext>(); var configSection = serviceContext.CodePackageActivationContext.GetConfigurationPackageObject("Config").Settings.Sections["ConfigurationConnection"]; var connectionInfo = new DocumentDbConnectionInfo { DatabaseName = configSection.Parameters["DatabaseName"].Value, Key = configSection.Parameters["Key"].Value, Uri = new Uri(configSection.Parameters["Uri"].Value) }; var dataSource = new DocumentDbDataSource("ConfigurationDataSource", connectionInfo); return(new DataSourceBackedConfigurationProvider(dataSource, services.GetRequiredService <ITransactionManager>())); }
public AuthenticationService(StatelessServiceContext context) : base(context) { var configSection = context.CodePackageActivationContext.GetConfigurationPackageObject("Config").Settings.Sections["ConfigurationConnection"]; var connectionInfo = new DocumentDbConnectionInfo { DatabaseName = configSection.Parameters["DatabaseName"].Value, Key = configSection.Parameters["Key"].Value, Uri = new Uri(configSection.Parameters["Uri"].Value) }; var dbDataSource = new DocumentDbDataSource("Database", connectionInfo); _userRepository = new DataSourceRepository <UserAuthenticationInfo> (dbDataSource, "UserAuthenticationInfos"); }