Exemple #1
0
        public static void ConfigureScopes(IEnumerable <Scope> scopes, DocumentDbServiceOptions options)
        {
            ScopeRepository scopeRepository = new ScopeRepository(options.CollectionNameResolver, options.ToConnectionSettings());
            var             allScopes       = scopeRepository.GetAllScopes().Result;

            if (!allScopes.Any())
            {
                foreach (var s in scopes)
                {
                    scopeRepository.AddScope(s.ToDocument()).Wait();
                }
            }
        }
Exemple #2
0
        public static void ConfigureClients(IEnumerable <Client> clients, DocumentDbServiceOptions options)
        {
            ClientRepository clientRepository = new ClientRepository(options.CollectionNameResolver, options.ToConnectionSettings());
            var allClients = clientRepository.GetAllClients().Result;

            if (!allClients.Any())
            {
                foreach (var c in clients)
                {
                    clientRepository.AddClient(c.ToDocument()).Wait();
                }
            }
        }