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


C# ISession.ChangeKeyspace方法代码示例

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


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

示例1: TestFixtureSetUp

        protected override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            _session = Session;
            _session.CreateKeyspace(_uniqueKsName);
            _session.ChangeKeyspace(_uniqueKsName);

            // Create necessary tables
            MappingConfiguration config1 = new MappingConfiguration();
            config1.MapperFactory.PocoDataFactory.AddDefinitionDefault(typeof(EntityWithTimeUuid),
                () => LinqAttributeBasedTypeDefinition.DetermineAttributes(typeof(EntityWithTimeUuid)));
            _tableEntityWithTimeUuid = new Table<EntityWithTimeUuid>(_session, config1);
            _tableEntityWithTimeUuid.Create();

            MappingConfiguration config2 = new MappingConfiguration();
            config2.MapperFactory.PocoDataFactory.AddDefinitionDefault(typeof(EntityWithNullableTimeUuid),
                () => LinqAttributeBasedTypeDefinition.DetermineAttributes(typeof(EntityWithNullableTimeUuid)));
            _tableEntityWithNullableTimeUuid = new Table<EntityWithNullableTimeUuid>(_session, config2);
            _tableEntityWithNullableTimeUuid.Create();

            _expectedTimeUuidObjectList = EntityWithTimeUuid.GetDefaultObjectList();
            _expectedNullableTimeUuidObjectList = EntityWithNullableTimeUuid.GetDefaultObjectList();

            _dateBefore = DateTimeOffset.Parse("2014-2-1");
            _dateAfter = DateTimeOffset.Parse("2014-4-1");
        }
开发者ID:mtf30rob,项目名称:csharp-driver,代码行数:26,代码来源:MinTimeUuid.cs

示例2: SetupTest

 public void SetupTest()
 {
     _session = TestClusterManager.GetTestCluster(1).Session;
     _uniqueKsName = TestUtils.GetUniqueKeyspaceName();
     _session.CreateKeyspace(_uniqueKsName);
     _session.ChangeKeyspace(_uniqueKsName);
 }
开发者ID:raideroflostark,项目名称:csharp-driver,代码行数:7,代码来源:Counter.cs

示例3: SetupTest

 public void SetupTest()
 {
     _session = Session;
     _uniqueKsName = TestUtils.GetUniqueKeyspaceName();
     _session.CreateKeyspace(_uniqueKsName);
     _session.ChangeKeyspace(_uniqueKsName);
 }
开发者ID:mtf30rob,项目名称:csharp-driver,代码行数:7,代码来源:Counter.cs

示例4: TestFixtureSetUp

        protected override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            _session = Session;
            _session.CreateKeyspace(_uniqueKsName);
            _session.ChangeKeyspace(_uniqueKsName);

            // Create necessary tables
            MappingConfiguration config1 = new MappingConfiguration();
            config1.MapperFactory.PocoDataFactory.AddDefinitionDefault(typeof (EntityWithTimeUuid),
                () => LinqAttributeBasedTypeDefinition.DetermineAttributes(typeof (EntityWithTimeUuid)));
            _tableEntityWithTimeUuid = new Table<EntityWithTimeUuid>(_session, config1);
            _tableEntityWithTimeUuid.Create();

            MappingConfiguration config2 = new MappingConfiguration();
            config2.MapperFactory.PocoDataFactory.AddDefinitionDefault(typeof (EntityWithNullableTimeUuid),
                () => LinqAttributeBasedTypeDefinition.DetermineAttributes(typeof (EntityWithNullableTimeUuid)));
            _tableEntityWithNullableTimeUuid = new Table<EntityWithNullableTimeUuid>(_session, config2);
            _tableEntityWithNullableTimeUuid.Create();

            _expectedTimeUuidObjectList = EntityWithTimeUuid.GetDefaultObjectList();
            for (int i=0; i<_expectedTimeUuidObjectList.Count; i++)
            {
                _expectedTimeUuidObjectList[i].StringType = i.ToString();
            }
        }
开发者ID:mtf30rob,项目名称:csharp-driver,代码行数:26,代码来源:Token.cs

示例5: SetupTest

 public void SetupTest()
 {
     _session = TestClusterManager.GetTestCluster(1).Session;
     _uniqueKsName = TestUtils.GetUniqueKeyspaceName();
     _session.CreateKeyspace(_uniqueKsName);
     TestUtils.WaitForSchemaAgreement(_session.Cluster);
     _session.ChangeKeyspace(_uniqueKsName);
 }
开发者ID:Virus-X,项目名称:csharp-driver,代码行数:8,代码来源:GetTable.cs

示例6: TestFixtureSetUp

 protected override void TestFixtureSetUp()
 {
     base.TestFixtureSetUp();
     _session = Session;
     _uniqueKsName = TestUtils.GetUniqueKeyspaceName();
     _session.CreateKeyspace(_uniqueKsName);
     _session.ChangeKeyspace(_uniqueKsName);
 }
开发者ID:mtf30rob,项目名称:csharp-driver,代码行数:8,代码来源:CreateTable.cs

示例7: TestFixtureSetUp

 public void TestFixtureSetUp()
 {
     var testCluster = TestClusterManager.GetTestCluster(1);
     _cluster = Cluster.Builder().AddContactPoint(testCluster.InitialContactPoint).Build();
     _session = _cluster.Connect();
     _uniqueKsName = TestUtils.GetUniqueKeyspaceName();
     _session.CreateKeyspace(_uniqueKsName);
     _session.ChangeKeyspace(_uniqueKsName);
 }
开发者ID:Virus-X,项目名称:csharp-driver,代码行数:9,代码来源:InsertTests.cs

示例8: SetupTest

        public void SetupTest()
        {
            _session = Session;
            _session.CreateKeyspace(_uniqueKsName);
            _session.ChangeKeyspace(_uniqueKsName);

            _entityList = AllDataTypesEntity.SetupDefaultTable(_session);

        }
开发者ID:mtf30rob,项目名称:csharp-driver,代码行数:9,代码来源:DeleteIf.cs

示例9: TestFixtureSetUp

        protected override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            _session = Session;
            _session.CreateKeyspace(_uniqueKsName);
            _session.ChangeKeyspace(_uniqueKsName);

            _movieTable = new Table<Movie>(_session, new MappingConfiguration());
            _movieTable.Create();
        }
开发者ID:alprema,项目名称:csharp-driver,代码行数:10,代码来源:InsertTests.cs

示例10: SetupTest

        public void SetupTest()
        {
            _session = Session;
            _session.CreateKeyspace(_uniqueKsName);
            _session.ChangeKeyspace(_uniqueKsName);

            _entityList = AllDataTypesEntity.SetupDefaultTable(_session);
            _table = new Table<AllDataTypesEntity>(_session, new MappingConfiguration());

        }
开发者ID:mtf30rob,项目名称:csharp-driver,代码行数:10,代码来源:Delete.cs

示例11: CreateMultiDcSchema

 public void CreateMultiDcSchema(ISession session, int dc1RF = 1, int dc2RF = 1)
 {
     session.Execute(String.Format(TestUtils.CreateKeyspaceGenericFormat, DefaultKeyspace, "NetworkTopologyStrategy",
                                       string.Format("'dc1' : {0}, 'dc2' : {1}", dc1RF, dc2RF)));
     TestUtils.WaitForSchemaAgreement(session.Cluster);
     session.ChangeKeyspace(DefaultKeyspace);
     TestUtils.WaitForSchemaAgreement(session.Cluster);
     session.Execute(String.Format("CREATE TABLE {0} (k int PRIMARY KEY, i int)", TableName));
     TestUtils.WaitForSchemaAgreement(session.Cluster);
 }
开发者ID:mtf30rob,项目名称:csharp-driver,代码行数:10,代码来源:PolicyTestTools.cs

示例12: TestFixtureSetUp

        protected override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            _session = Session;
            _session.CreateKeyspace(_uniqueKsName);
            _session.ChangeKeyspace(_uniqueKsName);

            _entityList = AllDataTypesEntity.SetupDefaultTable(_session);
            _table = new Table<AllDataTypesEntity>(_session, new MappingConfiguration());
        }
开发者ID:mtf30rob,项目名称:csharp-driver,代码行数:10,代码来源:Select.cs

示例13: TestFixtureSetUp

        public void TestFixtureSetUp()
        {
            var testCluster = TestClusterManager.GetTestCluster(1, DefaultMaxClusterCreateRetries, true, false);
            _cluster = Cluster.Builder().AddContactPoint(testCluster.InitialContactPoint).Build();
            _session = _cluster.Connect();
            _session.CreateKeyspace(_uniqueKsName);
            _session.ChangeKeyspace(_uniqueKsName);

            _movieTable = new Table<Movie>(_session, new MappingConfiguration());
            _movieTable.Create();
        }
开发者ID:RdHamilton,项目名称:csharp-driver,代码行数:11,代码来源:InsertTests.cs

示例14: TestFixtureSetUp

        protected override void TestFixtureSetUp()
        {
            if (CassandraVersion < Version.Parse("2.1.0"))
                Assert.Ignore("Requires Cassandra version >= 2.1");
            
            base.TestFixtureSetUp();
            _session = Session;

            _session.Execute(String.Format(TestUtils.CreateKeyspaceSimpleFormat, _uniqueKeyspaceName, 1));
            _session.ChangeKeyspace(_uniqueKeyspaceName);
            _session.Execute("CREATE TYPE song (id uuid, title text, artist text)");
            _session.UserDefinedTypes.Define(UdtMap.For<Song>());
        }
开发者ID:mtf30rob,项目名称:csharp-driver,代码行数:13,代码来源:LinqUdtTests.cs

示例15: CreateSchema

 public void CreateSchema(ISession session, int replicationFactor)
 {
     try
     {
         session.Execute(String.Format(TestUtils.CreateKeyspaceSimpleFormat, DefaultKeyspace, replicationFactor));
     }
     catch (AlreadyExistsException)
     {
     }
     TestUtils.WaitForSchemaAgreement(session.Cluster);
     session.ChangeKeyspace(DefaultKeyspace);
     session.Execute(String.Format("CREATE TABLE {0} (k int PRIMARY KEY, i int)", TableName));
     TestUtils.WaitForSchemaAgreement(session.Cluster);
 }
开发者ID:mtf30rob,项目名称:csharp-driver,代码行数:14,代码来源:PolicyTestTools.cs


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