コード例 #1
1
        public void SetUp()
        {
            _store = NewDocumentStore();
            _store.Initialize();

            // We first have to create the static indexes
            IndexCreation.CreateIndexes(typeof(Player_Index_R03).Assembly, _store);

            _teams = DataGenerator.CreateTeamList();

            // Store some players and teams in the database
            using (var session = _store.OpenSession())
            {
                foreach (var team in _teams)
                {
                    session.Store(team);
                }

                _players = DataGenerator.CreatePlayerListWithTeamIds();

                foreach (var player in _players)
                {
                    session.Store(player);
                }

                session.SaveChanges();
            }

            // Let's wait for indexing to happen
            // this method is part of RavenTestBase and thus should only be used in tests
            WaitForIndexing(_store);
        }
コード例 #2
0
ファイル: HelperUtilities.cs プロジェクト: neiz/RavenOverflow
        public static void CreateSeedData(IDocumentStore documentStore)
        {
            Condition.Requires(documentStore).IsNotNull();

            using (IDocumentSession documentSession = documentStore.OpenSession())
            {
                // First, check to make sure we don't have any data.
                var user = documentSession.Load<User>(1);
                if (user != null)
                {
                    // ooOooo! we have a user, so it's assumed we actually have some seeded data.
                    return;
                }

                // We have no users, so it's assumed we therefore have no data at all.
                // So lets fake some up :)

                // Users.
                ICollection<User> users = FakeUsers.CreateFakeUsers(50);
                StoreFakeEntities(users, documentSession);

                // Questions.
                ICollection<Question> questions = FakeQuestions.CreateFakeQuestions(users.Select(x => x.Id).ToList());
                StoreFakeEntities(questions, documentSession);

                documentSession.SaveChanges();

                // Make sure all our indexes are not stale.
                documentStore.WaitForStaleIndexesToComplete();
            }
        }
コード例 #3
0
        public RavenDbServiceOptions(string conStringName)
        {
            _store = new DocumentStore {ConnectionStringName = conStringName};
            _store.Initialize();

            IndexCreation.CreateIndexes(GetType().Assembly, _store);
        }
コード例 #4
0
        private static void SetupFacets( String id, IDocumentStore store )
        {
            var facet = new FacetSetup()
            {
                Id = id,
                Facets =
                {
                    new Facet<Orders.Product>()
                    {
                        Name = p=>p.Supplier
                    },
                    new Facet<Orders.Product>()
                    {
                        Name = p=>p.PricePerUser,
                        Ranges =
                        {
                            p=>p.PricePerUser <= 50,
                            p=>p.PricePerUser > 50 && p.PricePerUser <= 100,
                            p=>p.PricePerUser > 100 && p.PricePerUser <= 200,
                            p=>p.PricePerUser > 200,
                        }
                    },
                }
            };

            using ( var session = store.OpenSession() )
            {
                session.Store( facet );
                session.SaveChanges();
            }
        }
コード例 #5
0
ファイル: DBInit.cs プロジェクト: GunioRobot/vlko
        /// <summary>
        /// Registers the document store.
        /// </summary>
        /// <param name="documentStore">The document store.</param>
        public static void RegisterDocumentStore(IDocumentStore documentStore)
        {
            SessionFactory.DocumentStoreInstance = documentStore;

            documentStore.Conventions.CustomizeJsonSerializer += json => json.ReferenceLoopHandling = ReferenceLoopHandling.Serialize;

            // register custom contract resolver to handle relations
            documentStore.Conventions.JsonContractResolver = new RelationContractResolver(
                (DefaultRavenContractResolver)documentStore.Conventions.JsonContractResolver,
                documentStore.Conventions,
                ListOfModelTypes());

            var componentInstances = IoC.ResolveAllInstances<IComponentDbInit>().ToArray();

            // customize document store
            foreach (var componentDbInit in componentInstances)
            {
                componentDbInit.CustomizeDocumentStore(documentStore);
            }

            // register indexes
            foreach (var componentDbInit in componentInstances)
            {
                componentDbInit.RegisterIndexes(documentStore);
            }
        }
コード例 #6
0
 private UserWithGuid[] GetUsers(IDocumentStore documentStore)
 {
     using (var session = documentStore.QuerySession())
     {
         return session.Query<UserWithGuid>().ToArray();
     }
 }
コード例 #7
0
 public IdentityMapThinksIdsAreGlobal()
 {
     documentStore = Using(DocumentStore.ForTesting(TableMode.UseTempTables, connectionString));
     documentStore.Configuration.Document<Doc1>().Key(x => x.Id);
     documentStore.Configuration.Document<Doc2>().Key(x => x.Id);
     documentStore.Initialize();
 }
コード例 #8
0
        public RavenDbSessionStore(CryptographyConfiguration cryptographyConfiguration, IDocumentStore documentStore)
            : base(cryptographyConfiguration)
        {
            Guard.NotNull(() => documentStore, documentStore);

            this.documentStore = documentStore;
        }
コード例 #9
0
		private void ExecuteTest(IDocumentStore store)
		{
			CreateIndexAndSampleData(store);

			// there are 10K documents, each combination of "Lorem" and "Nullam" has 100 matching documents.
			// Suspect that this may be failing because each individual slice (Lorem: L and Nullam: N)
			// has 1000 documents, which is greater than default page size of 128.
			foreach (string L in Lorem)
			{
				foreach (string N in Nullam)
				{
					using (var session = store.OpenSession())
					{
						var result = session.Query<TestAttributes>("TestAttributesByAttributes")
									.Where(o => o.Attributes.Any(t => t.Key == "Lorem" && t.Value == L))
									.OrderBy(o => o.Id)
									.Intersect()
									.Where(o => o.Attributes.Any(t => t.Key == "Nullam" && t.Value == N))
									.ToList();

						Assert.Equal(100, result.Count);
					}
				}
			}
		}
コード例 #10
0
 public RavenDocStore()
 {
     _documentStore = new DocumentStore { Url = "http://localhost:8080", ResourceManagerId = Guid.NewGuid() };
     _documentStore.Initialize();
     _documentStore.DatabaseCommands.EnsureDatabaseExists("Configuration");
     IndexCreation.CreateIndexes(typeof(ScheduleMessagesInCoordinatorIndex).Assembly, _documentStore);
 }
コード例 #11
0
ファイル: RavenProfiler.cs プロジェクト: 925coder/ravendb
		/// <summary>
		/// Initializes the RavenProfiler for MVC.
		/// IMPORTANT! This method may only be called from the Application_Start method, otherwise
		/// it might lead to problems, since it modify the Routes table.
		/// </summary>
		public static void InitializeFor(IDocumentStore store, params string[] fieldsToFilter)
		{
			var existing = RouteTable.Routes
				.Select(x =>
				{
					var route = x as Route;
					if (route == null)
						return null;
					return route.RouteHandler;
				})
				.OfType<RavenProfilingHandler>()
				.FirstOrDefault();

			if (existing != null)
			{
				existing.AddStore(store);
				return;
			}
			store.Conventions.DisableProfiling = false;

			((DocumentStore)store).InitializeProfiling();
			
			ProfilingInformation.OnContextCreated += ProfilingInformationOnOnContextCreated;

			var ravenProfilingHandler = new RavenProfilingHandler(new HashSet<string>(fieldsToFilter ?? Enumerable.Empty<string>()));
			ravenProfilingHandler.AddStore(store);

			RouteTable.Routes.Insert(0, new Route("ravendb/profiling", new RouteValueDictionary(new { controller = "RavenProfilingHandler", action = "ProcessRequest" }), ravenProfilingHandler));
			GlobalFilters.Filters.Add(new RecordCurrentControllerContextFilter(), -100);
		}
コード例 #12
0
 //Change to allow for Multi- Tenancy cases
 //User has to call this method every time he creates a new tenant DB
 public static void CreateOrUpdateUserAuthIndex(IDocumentStore store,string databaseName)
 {
     // put this index into the ravendb database
     var catalog = new CompositionContainer(new AssemblyCatalog(typeof(ServiceStack_UserAuth_ByUserNameOrEmail).Assembly));
     IndexCreation.CreateIndexes(catalog, store.DatabaseCommands.ForDatabase(databaseName), store.Conventions);
     _isInitialized = true;
 }
コード例 #13
0
 public RavenMembershipRebootDatabase(string connectionStringName)
 {
     DocumentStore = new DocumentStore
         {
             ConnectionStringName = connectionStringName
         }.Initialize();
 }
コード例 #14
0
ファイル: Utils.cs プロジェクト: myarichuk/Chaos.Raven
 public static void ExecuteIndexes(IDocumentStore store)
 {
     new OrdersByCompany().Execute(store);
     new OrdersTotals().Execute(store);
     new ProductSales().Execute(store);
     new OrderLines_ByProduct().Execute(store);
 }
コード例 #15
0
 public static void CreateOrUpdateUserAuthIndex(IDocumentStore store)
 {
     // put this index into the ravendb database
     new ServiceStack_UserAuth_ByUserNameOrEmail().Execute(store);
     new ServiceStack_UserAuth_ByOAuthProvider().Execute(store);
     _isInitialized = true;
 }
コード例 #16
0
ファイル: RavenDB_1760.cs プロジェクト: WimVergouwe/ravendb
	    private void DoTest(IDocumentStore store1, IDocumentStore store2)
	    {
	        using (var session = store1.OpenSession())
	        {
	            session.Store(new Company());
	            session.SaveChanges();
	        }

	        using (var session = store2.OpenSession())
	        {
	            session.Store(new Company());
	            session.SaveChanges();
	        }

	        store1.DatabaseCommands.Put("marker", null, new RavenJObject(), new RavenJObject());

	        TellFirstInstanceToReplicateToSecondInstance();

	        WaitForReplication(store2, "marker");

	        var conflictException = Assert.Throws<ConflictException>(() =>
	        {
	            using (var session = store2.OpenSession())
	            {
	                var loadStartingWith = session.Advanced.LoadStartingWith<Company>("companies/");
	            }
	        });

	        Assert.Equal("Conflict detected on companies/1, conflict must be resolved before the document will be accessible",
	                     conflictException.Message);
	    }
コード例 #17
0
ファイル: Utils.cs プロジェクト: myarichuk/Chaos.Raven
        public static void CreateInitialData(IDocumentStore store, string databaseName)
        {
            store.DatabaseCommands.GlobalAdmin.EnsureDatabaseExists(databaseName);
            using (var bulkInsert = store.BulkInsert())
            {
                foreach (var category in DataFactory.Categories.GenerateMany(Constants.NumOfCategories))
                    bulkInsert.Store(category);

                foreach (var company in DataFactory.Companies.GenerateMany(Constants.NumOfCompanies))
                    bulkInsert.Store(company);

                foreach (var employee in DataFactory.Employees.GenerateMany(Constants.NumOfEmployees))
                    bulkInsert.Store(employee);

                foreach (var order in DataFactory.Orders.GenerateMany(Constants.NumOfOrders))
                    bulkInsert.Store(order);

                foreach (var product in DataFactory.Products.GenerateMany(Constants.NumOfProducts))
                    bulkInsert.Store(product);

                foreach (var region in DataFactory.Regions.GenerateMany(Constants.NumOfRegions))
                    bulkInsert.Store(region);

                foreach (var shipper in DataFactory.Shippers.GenerateMany(Constants.NumOfShippers))
                    bulkInsert.Store(shipper);

                foreach (var supplier in DataFactory.Suppliers.GenerateMany(Constants.NumOfSuppliers))
                    bulkInsert.Store(supplier);
            }

            new OrdersByCompany().Execute(store);
            new OrdersTotals().Execute(store);
            new ProductSales().Execute(store);
            new OrderLines_ByProduct().Execute(store);
        }
コード例 #18
0
 private void LoadDocs(IDocumentStore store)
 {
     using (var session = store.OpenSession())
     {
         session.Load<Order>(orderIDs);
     }
 }
コード例 #19
0
ファイル: Program.cs プロジェクト: wheeliemow/RaccoonBlog
		private static void CreateSections(IDocumentStore store)
		{
			Console.WriteLine("Creating sections");
			using (IDocumentSession s = store.OpenSession())
			{
				var sections = new[]
					{
						new Section {Title = "Future Posts", ControllerName = "Section", ActionName = "FuturePosts"},
						new Section {Title = "Statistics", ControllerName = "Section", ActionName = "PostsStatistics"},
						new Section {Title = "Tags", ControllerName = "Section", ActionName = "TagsList"},
						new Section {Title = "Archive", ControllerName = "Section", ActionName = "ArchivesList"},
					};

				var i = 0;
				foreach (var section in sections)
				{
					section.Position = i;
					section.IsActive = true;
					s.Store(section);
					i++;
				}
				s.SaveChanges();
			}
			Console.WriteLine("Finish creating sections");
		}
コード例 #20
0
 public static IDocumentStore Initialize()
 {
     instance = new EmbeddableDocumentStore { ConnectionStringName = "RavenDB" };
     instance.Conventions.IdentityPartsSeparator = "-";
     instance.Initialize();
     return instance;
 }
コード例 #21
0
        public QuestionsController(IDocumentStore documentStore, IQuestionService questionService)
            : base(documentStore)
        {
            Condition.Requires(questionService).IsNotNull();

            _questionService = questionService;
        }
コード例 #22
0
        public HomeControllerTests()
        {
            _documentStore = new EmbeddableDocumentStore { RunInMemory = true }
                .Initialize();

            _documentSession = _documentStore.OpenSession();
        }
コード例 #23
0
        public override void Initialize(string name, NameValueCollection config)
        {
            if (config == null)
                throw new ArgumentNullException("config");

            _providerName = name;

            base.Initialize(name, config);

            SetConfigurationProperties(config);

            if (_documentStore == null)
            {
                if (string.IsNullOrEmpty(config["connectionStringName"]))
                    throw new ConfigurationErrorsException("Must supply a connectionStringName.");

                _documentStore = new DocumentStore
                {
                    ConnectionStringName = config["connectionStringName"],
                };

                _documentStore.Initialize();
            }

            // create indexes
            _documentStore.ExecuteIndex(new Users_ByApplicationNameAndRoleName());
        }
コード例 #24
0
        public void SetUp()
        {
            store = NewDocumentStore();
            using(var session = store.OpenSession())
            {
                session.Store(new Account
                {
                    Transactions =
                        {
                            new Transaction(1),
                            new Transaction(3),
                        }
                });
                session.Store(new Account
                {
                    Transactions =
                        {
                            new Transaction(2),
                            new Transaction(4),
                        }
                });

                session.SaveChanges();
            }
        }
コード例 #25
0
 private static ServerSettings GetServerSettings(IDocumentStore documentStore)
 {
     using (var session = documentStore.OpenSession())
     {
         return session.Load<ServerSettings>("ServerSettings/1");
     }
 }
コード例 #26
0
ファイル: HiLoKeyGenerator.cs プロジェクト: JPT123/ravendb
		/// <summary>
		/// Initializes a new instance of the <see cref="HiLoKeyGenerator"/> class.
		/// </summary>
		/// <param name="documentStore">The document store.</param>
		/// <param name="tag">The tag.</param>
		/// <param name="capacity">The capacity.</param>
		public HiLoKeyGenerator(IDocumentStore documentStore, string tag, long capacity)
		{
			this.documentStore = documentStore;
			this.tag = tag;
			this.capacity = capacity;
			current = 0;
		}
コード例 #27
0
ファイル: RavenDB_1033.cs プロジェクト: j2jensen/ravendb
 public RavenDB_1033()
 {
     store = NewDocumentStore(settings: new Dictionary<string, string>
         {
             { "Raven/HttpCompression", "true" } // HttpCompression is enabled by default, just in case of changing it in the future
         });
 }
コード例 #28
0
 public static IEnumerable<Func<CancellationToken, Task>> Tasks(ICommandSender service, IDocumentStore docs,
     bool isTest)
 {
     var flow = new DomainSender(service);
     // more tasks go here
     yield break;
 }
コード例 #29
0
ファイル: TestUtil.cs プロジェクト: arelee/ravendb
		public static void WaitForIndexing(IDocumentStore store)
		{
			while (store.DatabaseCommands.GetStatistics().StaleIndexes.Length > 0)
			{
				Thread.Sleep(100);
			}
		}
コード例 #30
0
        public RavenDbErrorLog(IDictionary config)
        {
            if (string.IsNullOrWhiteSpace(_version))
            {
                _version = RetrieveVersion();   
            }            
            
            if (_externalProvidedDocumentStore != null)
            {
                _documentStore = _externalProvidedDocumentStore;
            }
            else
            {
                if (config == null)
                {
                    throw new ArgumentNullException("config");
                }

                _connectionStringName = GetConnectionStringName(config);
                LoadApplicationName(config);
                InitDocumentStore();
            }

            ConfigureDocumentStore(_documentStore);
        }
コード例 #31
0
        private static async Task <ServerSupportedFeatures> DetectServerSupportedFeatures(IDocumentStore store)
        {
            var buildNumber = await store.AsyncDatabaseCommands.GlobalAdmin.GetBuildNumberAsync();

            if (buildNumber == null || string.IsNullOrEmpty(buildNumber.ProductVersion))
            {
                ShowProgress("Server version is not available. Running in legacy mode which does not support transformers, documents streaming and identities smuggling.");
                return(new ServerSupportedFeatures
                {
                    IsTransformersSupported = false,
                    IsDocsStreamingSupported = false,
                    IsIdentitiesSmugglingSupported = false,
                });
            }

            var smugglerVersion    = FileVersionInfo.GetVersionInfo(AssemblyHelper.GetAssemblyLocationFor <SmugglerDatabaseApiBase>()).ProductVersion;
            var subSmugglerVersion = smugglerVersion.Substring(0, 3);

            var subServerVersion = buildNumber.ProductVersion.Substring(0, 3);
            var intServerVersion = int.Parse(subServerVersion.Replace(".", string.Empty));

            if (intServerVersion < 25)
            {
                ShowProgress("Running in legacy mode, importing/exporting transformers and identities is not supported. Server version: {0}. Smuggler version: {1}.", subServerVersion, subSmugglerVersion);
                return(new ServerSupportedFeatures
                {
                    IsTransformersSupported = false,
                    IsDocsStreamingSupported = false,
                    IsIdentitiesSmugglingSupported = false,
                });
            }

            if (intServerVersion == 25)
            {
                ShowProgress("Running in legacy mode, importing/exporting identities is not supported. Server version: {0}. Smuggler version: {1}.", subServerVersion, subSmugglerVersion);
                return(new ServerSupportedFeatures
                {
                    IsTransformersSupported = true,
                    IsDocsStreamingSupported = true,
                    IsIdentitiesSmugglingSupported = false,
                });
            }

            return(new ServerSupportedFeatures
            {
                IsTransformersSupported = true,
                IsDocsStreamingSupported = true,
                IsIdentitiesSmugglingSupported = true,
            });
        }
コード例 #32
0
 public ModelModelBinder(IDocumentStore documentStore)
 {
     _documentStore = documentStore;
 }
コード例 #33
0
 public NotificationController(IDocumentStore documentStore)
 {
     _documentStore = documentStore;
 }
コード例 #34
0
        private static void DoTest(IDocumentStore store)
        {
            new FooBarTransformer().Execute(store);

            using (var session = store.OpenSession())
            {
                var bar1 = new Bar
                {
                    Id   = "bars/1",
                    Name = "1"
                };

                var bar2 = new Bar
                {
                    Id   = "bars/2",
                    Name = "2"
                };
                var foo1 = new Foo()
                {
                    Id   = "foos/1",
                    Bars = new[] { bar1.Id, bar2.Id }
                };

                var foo2 = new Foo()
                {
                    Id   = "foos/2",
                    Name = "Foo_Two"
                };

                session.Store(bar1);
                session.Store(bar2);
                session.Store(foo1);
                session.Store(foo2);

                session.SaveChanges();

                var fooBars =
                    session.Advanced.LoadStartingWith <FooBarTransformer, FooBarDto>("foos/",
                                                                                     configure:
                                                                                     x => x.AddQueryParam("input", "testParam"))
                    .OrderBy(x => x.Name)
                    .ToArray();

                Assert.Equal(2, fooBars.Length);

                Assert.Null(fooBars[0].Name);
                Assert.Equal(2, fooBars[0].Bars.Length);
                Assert.Equal("1", fooBars[0].Bars[0]);
                Assert.Equal("2", fooBars[0].Bars[1]);
                Assert.Equal("testParam", fooBars[0].Input);

                Assert.Equal("Foo_Two", fooBars[1].Name);
                Assert.Equal(0, fooBars[1].Bars.Length);
                Assert.Equal("testParam", fooBars[1].Input);
            }

            using (var session = store.OpenAsyncSession())
            {
                var fooBars = session.Advanced.LoadStartingWithAsync <FooBarTransformer, FooBarDto>("foos/", configure:
                                                                                                    x => x.AddQueryParam("input", "testParam")).Result
                              .OrderBy(x => x.Name).ToArray();


                Assert.Equal(2, fooBars.Length);

                Assert.Null(fooBars[0].Name);
                Assert.Equal(2, fooBars[0].Bars.Length);
                Assert.Equal("1", fooBars[0].Bars[0]);
                Assert.Equal("2", fooBars[0].Bars[1]);
                Assert.Equal("testParam", fooBars[0].Input);

                Assert.Equal("Foo_Two", fooBars[1].Name);
                Assert.Equal(0, fooBars[1].Bars.Length);
                Assert.Equal("testParam", fooBars[1].Input);
            }
        }
コード例 #35
0
 public MartenProvider(IDocumentStore store)
 {
     _store = store;
 }
コード例 #36
0
 // Take in IDocumentStore as a constructor argument
 public UsingDocumentSessionHandler(IDocumentStore store)
 {
 }
 /// <summary>
 /// Configures the given document store to be used when storing subscriptions
 /// </summary>
 /// <param name="cfg"></param>
 /// <param name="documentStore">The document store to use</param>
 public static PersistenceExtensions <RavenDBPersistence> UseDocumentStoreForSubscriptions(this PersistenceExtensions <RavenDBPersistence> cfg, IDocumentStore documentStore)
 {
     DocumentStoreManager.SetDocumentStore <StorageType.Subscriptions>(cfg.GetSettings(), documentStore);
     return(cfg);
 }
コード例 #38
0
 public MessageFailureResolvedHandler(IDocumentStore store, IDomainEvents domainEvents)
 {
     this.store        = store;
     this.domainEvents = domainEvents;
 }
コード例 #39
0
 public WireUpFailedMessageNotifications(FailedMessageViewIndexNotifications notifications, IDocumentStore store)
 {
     this.notifications = notifications;
     this.store         = store;
 }
コード例 #40
0
        public static string CreateEntities(IDocumentStore documentStore)
        {
            const string questionId = @"question/259";
            const string answerId   = @"answer/540";

            using (IDocumentSession session = documentStore.OpenSession())
            {
                var user = new User {
                    Id = @"user/222", DisplayName = "John Doe"
                };
                session.Store(user);

                var question = new Question
                {
                    Id      = questionId,
                    Title   = "How to do this in RavenDb?",
                    Content = "I'm trying to find how to model documents for better DDD support.",
                    UserId  = @"user/222"
                };
                session.Store(question);

                var answer = new AnswerEntity
                {
                    Id       = answerId,
                    Question = question,
                    Content  = "This is doable",
                    UserId   = user.Id
                };

                session.Store(new Answer
                {
                    Id         = answer.Id,
                    UserId     = answer.UserId,
                    QuestionId = answer.Question.Id,
                    Content    = answer.Content
                });

                var vote1 = new AnswerVoteEntity {
                    Id = "votes\\1", Answer = answer, QuestionId = questionId, Delta = 2
                };
                session.Store(new AnswerVote
                {
                    QuestionId = vote1.QuestionId,
                    AnswerId   = vote1.Answer.Id,
                    Delta      = vote1.Delta
                });

                var vote2 = new AnswerVoteEntity {
                    Id = "votes\\2", Answer = answer, QuestionId = questionId, Delta = 3
                };
                session.Store(new AnswerVote
                {
                    QuestionId = vote2.QuestionId,
                    AnswerId   = vote2.Answer.Id,
                    Delta      = vote2.Delta
                });

                session.SaveChanges();
            }
            return(answerId);
        }
コード例 #41
0
 public RavenUserAccountRepository(IDocumentStore documentStore)
 {
     this.documentStore = documentStore;
     documentSession    = documentStore.OpenSession();
     items = documentSession.Query <HierarchicalUserAccount>();
 }
コード例 #42
0
 public TitleEpisodeRepository(IDocumentStore store) => _store = store;
コード例 #43
0
 protected override void SetupDatabase(IDocumentStore store)
 {
     using var session = store.OpenSession();
     session.Store(TenantData.GetFirst());
     session.SaveChanges();
 }
コード例 #44
0
ファイル: IndexMerging.cs プロジェクト: morhilai/ravendb
 private static IndexDefinition[] GetAutoIndexes(IDocumentStore store)
 {
     return(store.Maintenance.Send(new GetIndexesOperation(0, 1024)).Where(x => x.Name.StartsWith("Auto/")).ToArray());
 }
コード例 #45
0
 private static void AssertIndexHasNoErrors(IDocumentStore store, string indexName)
 {
     Assert.Equal(0, store.Maintenance.Send(new GetIndexErrorsOperation(new[] { indexName }))[0].Errors.Length);
 }
コード例 #46
0
 public DocumentSubscriptions(IDocumentStore store)
 {
     _store = store;
 }
コード例 #47
0
 private AuthorizedSession(IDocumentStore store, IDocumentSession session, AuthorizedUser authorizedUser)
 {
     _store          = store;
     _session        = session;
     _authorizedUser = authorizedUser;
 }
コード例 #48
0
 public MultiTenantDocumentStore(IDocumentStore store)
 {
     _store = store;
 }
コード例 #49
0
 protected bool WaitForDocument(IDocumentStore store,
                                string docId,
                                int timeout = 10000)
 {
     return(WaitForDocument <dynamic>(store, docId, predicate: null, timeout: timeout));
 }
コード例 #50
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RavenMessageStore"/> class.
 /// </summary>
 /// <param name="documentStore">The document store.</param>
 /// <param name="logger">The logger.</param>
 public RavenMessageStore(IDocumentStore documentStore, ILog logger)
 {
     this.documentStore = documentStore;
     this.logger        = logger;
 }
コード例 #51
0
 public AllProcessedMessagesRoutedMessageSource(IDocumentStore store)
 {
     _store = store;
 }
コード例 #52
0
 protected static DatabasePutResult CreateClusterDatabase(string databaseName, IDocumentStore store, int replicationFactor = 2)
 {
     return(store.Maintenance.Server.Send(new CreateDatabaseOperation(new DatabaseRecord(databaseName), replicationFactor)));
 }
コード例 #53
0
 public TeamService(IDocumentStore documentStore, ILogger <TeamService> logger, PickemEventer pickemEventer)
 {
     _documentStore = documentStore;
     _logger        = logger;
     _pickemEventer = pickemEventer;
 }
コード例 #54
0
 public void TestCleanup()
 {
     _documentStore = null;
     DocumentStoreHelper.KillRaven();
 }
コード例 #55
0
 public MartenNodeDiscovery(MartenSubscriptionSettings settings)
 {
     _documentStore = settings.Store;
 }
コード例 #56
0
 protected override void SetupDatabase(IDocumentStore store)
 {
     store.ExecuteIndex(new FavIndex());
     WaitForIndexing(store);
 }
コード例 #57
0
 public RavenFileStorageService(IDocumentStore documentStore)
 {
     this.documentStore = documentStore;
 }
コード例 #58
0
 public static IDocumentStore ApplyGeoConventions(this IDocumentStore store)
 {
     store.Conventions.JsonContractResolver    = new GeoContractResolver();
     store.Conventions.CustomizeJsonSerializer = x => x.Converters.Add(new CoordinateConverter());
     return(store);
 }
コード例 #59
0
        public ReturnToSenderDequeuer(IBodyStorage bodyStorage, ISendMessages sender, IDocumentStore store, IDomainEvents domainEvents, Configure configure)
        {
            this.sender      = sender;
            this.bodyStorage = bodyStorage;

            Action executeOnFailure = () =>
            {
                if (IsCounting)
                {
                    CountMessageAndStopIfReachedTarget();
                }
                else
                {
                    timer.Change(TimeSpan.FromSeconds(45), Timeout.InfiniteTimeSpan);
                }
            };

            faultManager = new CaptureIfMessageSendingFails(store, domainEvents, executeOnFailure);
            timer        = new Timer(state => StopInternal());
            InputAddress = Address.Parse(configure.Settings.EndpointName()).SubScope("staging");
        }
コード例 #60
0
ファイル: MartenCommand.cs プロジェクト: tonykaralis/marten
 protected abstract Task <bool> execute(IDocumentStore store, T input);