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


C# ISession.CreateKeyspace方法代码示例

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


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

示例1: 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

示例2: SetupTest

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

示例3: 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

示例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();
            _expectedNullableTimeUuidObjectList = EntityWithNullableTimeUuid.GetDefaultObjectList();

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

示例5: 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

示例6: 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

示例7: SetupTest

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

            _entityList = AllDataTypesEntity.SetupDefaultTable(_session);

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

示例8: 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

示例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: 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

示例11: 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

示例12: 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

示例13: TestFixtureSetUp

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

            // drop table if exists, re-create
            var table = _session.GetTable<Movie>();
            table.Create();

            //Insert some data
            foreach (var movie in _movieList)
                table.Insert(movie).Execute();
        }
开发者ID:mtf30rob,项目名称:csharp-driver,代码行数:15,代码来源:TableSelectDefault.cs

示例14: SetupTest

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

            // drop table if exists, re-create
            var config = new Map<Movie>().PartitionKey(c => c.MovieMaker);
            var mappingConfig = new MappingConfiguration().Define(config);
            _mapper = new Mapper(_session, mappingConfig);
            _movieTable = new Table<Movie>(_session, mappingConfig);
            _movieTable.Create();

            //Insert some data
            foreach (var movie in _movieList)
                _movieTable.Insert(movie).Execute();
        }
开发者ID:et1975,项目名称:csharp-driver,代码行数:17,代码来源:Update.cs

示例15: SetupSessionAndCluster

        private ITestCluster SetupSessionAndCluster(int nodes, Dictionary<string, string> replication = null)
        {
            ITestCluster testCluster = TestClusterManager.GetTestCluster(nodes);
            _session = testCluster.Session;
            _ksName = TestUtils.GetUniqueKeyspaceName();
            _session.CreateKeyspace(_ksName, replication);
            TestUtils.WaitForSchemaAgreement(_session.Cluster);
            _session.ChangeKeyspace(_ksName);
            _table = new Table<ManyDataTypesEntity>(_session, new MappingConfiguration());
            _table.Create();
            _defaultPocoList = ManyDataTypesEntity.GetDefaultAllDataTypesList();
            _preparedStatement = _session.Prepare(_preparedInsertStatementAsString);
            foreach (var manyDataTypesEntity in _defaultPocoList)
                _session.Execute(GetBoundInsertStatementBasedOnEntity(manyDataTypesEntity));

            return testCluster;
        }
开发者ID:mtf30rob,项目名称:csharp-driver,代码行数:17,代码来源:ConsistencyTests.cs


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