当前位置: 首页>>代码示例>>C#>>正文


C# DocumentStore.ParseConnectionString方法代码示例

本文整理汇总了C#中Raven.Client.Document.DocumentStore.ParseConnectionString方法的典型用法代码示例。如果您正苦于以下问题:C# DocumentStore.ParseConnectionString方法的具体用法?C# DocumentStore.ParseConnectionString怎么用?C# DocumentStore.ParseConnectionString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Raven.Client.Document.DocumentStore的用法示例。


在下文中一共展示了DocumentStore.ParseConnectionString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EnsureWellFormedConnectionStrings_ParsingWithEndingSemicolons_Successful

		public void EnsureWellFormedConnectionStrings_ParsingWithEndingSemicolons_Successful()
		{
			var documentStore = new DocumentStore();
			documentStore.ParseConnectionString("Url=http://localhost:10301;");
			Assert.DoesNotContain(";", documentStore.Url);
			documentStore.ParseConnectionString("Url=http://localhost:10301/;");
			Assert.DoesNotContain(";", documentStore.Url);
		}
开发者ID:kblooie,项目名称:ravendb,代码行数:8,代码来源:ConnectionStringParsing.cs

示例2: RavenDataProvider

 public RavenDataProvider(string connectionString)
     : base(connectionString)
 {
     _store = new DocumentStore();
     _store.ParseConnectionString(connectionString);
     _store.Initialize();
 }
开发者ID:pbering,项目名称:SitecoreData,代码行数:7,代码来源:RavenDataProvider.cs

示例3: InitializeDocumentsCursor

        private async Task InitializeDocumentsCursor(CancellationToken cancellation)
        {
            using (var store = new DocumentStore())
            {
                store.ParseConnectionString(configuration.ConnectionString);
                store.Initialize(false);

                using (var session = store.OpenAsyncSession())
                {
                    if (String.IsNullOrEmpty(configuration.Query))
                    {
                        documentsCursor = await session.Advanced.StreamAsync<RavenJObject>(Etag.Empty, 0, int.MaxValue, null, cancellation);
                    }
                    else
                    {
                        var query = String.IsNullOrEmpty(configuration.Index)
                            ? session.Advanced.AsyncDocumentQuery<RavenJObject>()
                            : session.Advanced.AsyncDocumentQuery<RavenJObject>(configuration.Index);

                        // Streaming query API does not create a dynamic index, so user have to specify one if query is provided: http://issues.hibernatingrhinos.com/issue/RavenDB-1410
                        documentsCursor = await session.Advanced.StreamAsync<RavenJObject>(
                            query.Where(configuration.Query).NoCaching().NoTracking(), cancellation);
                    }
                }
            }
        }
开发者ID:kingkino,项目名称:azure-documentdb-datamigrationtool,代码行数:26,代码来源:RavenDbSourceAdapter.cs

示例4: CreateStore

 private static DocumentStore CreateStore(string connectionString, bool createDatabase)
 {
     var store = new DocumentStore();
     store.ParseConnectionString(connectionString);
     store.Initialize(createDatabase);
     return store;
 }
开发者ID:kingkino,项目名称:azure-documentdb-datamigrationtool,代码行数:7,代码来源:RavenDbHelper.cs

示例5: check_illegal_connstrings

		public void check_illegal_connstrings()
		{
			using (var store = new DocumentStore())
			{
				Assert.Throws<System.ArgumentException>(() => store.ParseConnectionString(string.Empty));
			}
		}
开发者ID:WimVergouwe,项目名称:ravendb,代码行数:7,代码来源:ConnectionStrings.cs

示例6: RavenDataProvider

        public RavenDataProvider(string connectionString)
            : base(connectionString)
        {
            _store = new DocumentStore();
            _store.ParseConnectionString(connectionString);
            _store.Initialize();

            _aggressiveCacheFor = TimeSpan.FromSeconds(60);
        }
开发者ID:vigneshchandrab,项目名称:SitecoreData,代码行数:9,代码来源:RavenDataProvider.cs

示例7: Can_get_api_key

        public void Can_get_api_key()
        {
            using (var store = new DocumentStore())
            {
                store.ParseConnectionString("Url=http://localhost:8079/;ApiKey=d5723e19-92ad-4531-adad-8611e6e05c8a;");

                Assert.Equal("d5723e19-92ad-4531-adad-8611e6e05c8a", store.ApiKey);
            }
        }
开发者ID:j2jensen,项目名称:ravendb,代码行数:9,代码来源:ConnectionStrings.cs

示例8: Create

        public IDocumentStore Create()
        {
            if (IsEmpty())
            {
                var defaultDataDirectory = AppDomain.CurrentDomain.SetupInformation.ApplicationBase.ParentDirectory().AppendPath("data");
                return new RavenDbSettings {DataDirectory = defaultDataDirectory}.Create();
            }

            if (Url.IsNotEmpty())
            {
                var store = new DocumentStore
                {
                    Url = Url
                };

                if (ConnectionString.IsNotEmpty())
                {
                    store.ParseConnectionString(ConnectionString);
                }

                return store;
            }

            if (DataDirectory.IsNotEmpty())
            {
                return new EmbeddableDocumentStore
                {
                    DataDirectory = DataDirectory,
                    UseEmbeddedHttpServer = UseEmbeddedHttpServer
                };
            }

            if (RunInMemory)
            {
                var store = new EmbeddableDocumentStore
                {
                    RunInMemory = true,
                    UseEmbeddedHttpServer = UseEmbeddedHttpServer
                };

                if (Url.IsNotEmpty())
                {
                    store.Url = Url;
                }

                if (Port > 0)
                {
                    store.Configuration.Port = Port;
                }

                return store;
            }

            throw new ArgumentOutOfRangeException("settings");
        }
开发者ID:joemcbride,项目名称:fubumvc,代码行数:55,代码来源:RavenDbSettings.cs

示例9: RunActivitiesImport

        public void RunActivitiesImport()
        {
            var store = new DocumentStore();
            store.ParseConnectionString("Url=http://localhost:8888/");
            store.Initialize();

            using (IDocumentSession db = store.OpenSession())
            {
                var importer = Importer.CreateImporter(db, new ActivitiesMapping());
                importer.Import(@"C:\Work\pressures-data\Human_Activities_Metadata_Catalogue.csv");
            }
        }
开发者ID:jncc,项目名称:topcat,代码行数:12,代码来源:import_runner.cs

示例10: TestConnectionAsync

        /// <summary>
        /// Tests the RavenDB connection.
        /// </summary>
        /// <param name="connectionString">RavenDB connection string to use to connect.</param>
        public async Task TestConnectionAsync(string connectionString)
        {
            if (String.IsNullOrEmpty(connectionString))
                throw Errors.ConnectionStringMissing();

            using (var store = new DocumentStore())
            {
                store.ParseConnectionString(connectionString);
                store.Initialize(false);
                
                await store.AsyncDatabaseCommands.GetStatisticsAsync();
            }
        }
开发者ID:kingkino,项目名称:azure-documentdb-datamigrationtool,代码行数:17,代码来源:RavenDbProbeClient.cs

示例11: can_work_with_default_db

        public void can_work_with_default_db()
        {
            using (var store = new DocumentStore())
            {
                store.ParseConnectionString("Url=http://localhost:8079/;DefaultDatabase=DevMachine;ResourceManagerId=d5723e19-92ad-4531-adad-8611e6e05c8a;");

                Assert.Equal("http://localhost:8079", store.Url);
                Assert.Equal("http://localhost:8079 (DB: DevMachine)", store.Identifier);
                Assert.NotNull(store.Credentials);
                Assert.Equal("DevMachine", store.DefaultDatabase);
                Assert.True(store.EnlistInDistributedTransactions);
            }
        }
开发者ID:j2jensen,项目名称:ravendb,代码行数:13,代码来源:ConnectionStrings.cs

示例12: check_url_and_rmid

		public void check_url_and_rmid()
		{
			using (var store = new DocumentStore())
			{
				store.ParseConnectionString("Url=http://localhost:8079/;ResourceManagerId=d5723e19-92ad-4531-adad-8611e6e05c8a;");

				Assert.Equal("http://localhost:8079", store.Url);
				Assert.Equal("http://localhost:8079", store.Identifier);
				Assert.NotNull(store.Credentials);
				Assert.Null(store.DefaultDatabase);
				Assert.True(store.EnlistInDistributedTransactions);
			}
		}
开发者ID:WimVergouwe,项目名称:ravendb,代码行数:13,代码来源:ConnectionStrings.cs

示例13: Load

        public override void Load()
        {
            var connStr = ConfigurationManager.AppSettings["RAVENHQ_CONNECTION_STRING"];
            var store = new DocumentStore();
            store.ParseConnectionString(connStr);
            store.Initialize();

            Kernel.Bind<IDocumentSession>()
                .ToMethod(ctx => store.OpenSession())
                .InRequestScope();

            this.BindFilter<RavenFilter>(FilterScope.Controller, 0);
        }
开发者ID:jasondentler,项目名称:kelli,代码行数:13,代码来源:RavenModule.cs

示例14: WillNotAffectResourceManagerId

		public void WillNotAffectResourceManagerId()
		{
			var resourceManagerId = Guid.NewGuid();
			using (var store = new DocumentStore
			{
				ResourceManagerId = resourceManagerId
			})
			{
				store.ParseConnectionString("Url=http://localhost:8079/;");

				Assert.Equal(resourceManagerId, store.ResourceManagerId);
			}
		}
开发者ID:neiz,项目名称:ravendb,代码行数:13,代码来源:ConnectionStrings.cs

示例15: check_url_and_defaultdb

		public void check_url_and_defaultdb()
		{
			using (var store = new DocumentStore())
			{
				store.ParseConnectionString("Url=http://localhost:8079/;DefaultDatabase=DevMachine;");

				Assert.Equal("http://localhost:8079", store.Url);
				Assert.Equal("http://localhost:8079 (DB: DevMachine)", store.Identifier);
				Assert.NotNull(store.ResourceManagerId);
				Assert.NotNull(store.Credentials);
				Assert.Equal("DevMachine", store.DefaultDatabase);
				Assert.True(store.EnlistInDistributedTransactions);
			}
		}
开发者ID:WimVergouwe,项目名称:ravendb,代码行数:14,代码来源:ConnectionStrings.cs


注:本文中的Raven.Client.Document.DocumentStore.ParseConnectionString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。