Ejemplo n.º 1
0
        public void CanUseTempAndGlobalTempTablesConcurrently()
        {
            Should.NotThrow(() =>
            {
                var configurator = new LambdaHybridDbConfigurator(x => x.Document<Case>());

                using (DocumentStore.ForTesting(TableMode.UseTempDb, configurator: configurator))
                using (DocumentStore.ForTesting(TableMode.UseTempTables, configurator: configurator)) { }
            });
        }
Ejemplo n.º 2
0
        public void CanUseTempDb()
        {
            var sessionkey = Guid.NewGuid().ToString();

            UseTempDb(sessionkey);

            var configurator = new LambdaHybridDbConfigurator(x =>
            {
                x.UseTableNamePrefix(sessionkey);
                x.Document<Case>();
            });

            using (var globalStore1 = DocumentStore.ForTesting(TableMode.UseTempDb, configurator))
            {
                var id = NewId();
                globalStore1.Insert(globalStore1.Configuration.GetDesignFor<Case>().Table, id, new { });

                using (var globalStore2 = DocumentStore.ForTesting(TableMode.UseTempDb, configurator))
                {
                    var result = globalStore2.Get(globalStore2.Configuration.GetDesignFor<Case>().Table, id);

                    result.ShouldNotBe(null);
                }
            }

            // the tempdb connection does not currently delete it's own tables
            // database.QuerySchema().ShouldNotContainKey("Cases");
        }