Exemple #1
0
        public async Task CanGetAll()
        {
            RepoUtil.Reset(_repo);

            await _repo.AddScope(ObjectMother.CreateScopeDocument("scope1"));

            await _repo.AddScope(ObjectMother.CreateScopeDocument("scope2"));

            await _repo.AddScope(ObjectMother.CreateScopeDocument("scope3"));

            var result = await _repo.GetAllScopes();

            Assert.AreEqual(3, result.Count());
        }
 public static void ConfigureScopes(IEnumerable<Scope> scopes, DocumentDbServiceOptions options)
 {
     ScopeRepository scopeRepository = new ScopeRepository(options.ToConnectionSettings());
     var allScopes = scopeRepository.GetAllScopes().Result;
     if (!allScopes.Any())
     {
         foreach (var s in scopes)
         {
             scopeRepository.AddScope(s.ToDocument()).Wait();
         }
     }
 }
Exemple #3
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();
                }
            }
        }