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


C# IIndex.IndexCreate方法代码示例

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


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

示例1: TestFixtureSetUp

 public override void TestFixtureSetUp()
 {
     base.TestFixtureSetUp();
     connection.RunAsync(Query.DbCreate("test")).Wait();
     connection.RunAsync(Query.Db("test").TableCreate("table")).Wait();
     testTable = Query.Db("test").Table<TestObject>("table");
     nameIndex = testTable.IndexDefine("index1", o => o.Name);
     connection.Run(nameIndex.IndexCreate());
     connection.Run(nameIndex.IndexWait());
 }
开发者ID:karlgrz,项目名称:rethinkdb-net,代码行数:10,代码来源:MultiObjectTests.cs

示例2: TestFixtureSetUp

 public override void TestFixtureSetUp()
 {
     base.TestFixtureSetUp();
     connection.RunAsync(Query.DbCreate("test")).Wait();
     connection.RunAsync(Query.Db("test").TableCreate("table")).Wait();
     testTable = Query.Db("test").Table<TestObject>("table");
     nameIndex = testTable.IndexDefine("index1", o => o.Name);
     connection.Run(nameIndex.IndexCreate());
     connection.Run(nameIndex.IndexWait()).ToArray(); // ToArray ensures that the IEnumerable is actually evaluated completely and the wait is completed
 }
开发者ID:nkreipke,项目名称:rethinkdb-net,代码行数:10,代码来源:MultiObjectTests.cs

示例3: TestFixtureSetUp

        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            connection.RunAsync(Query.DbCreate("test")).Wait();
            connection.RunAsync(Query.Db("test").TableCreate("table1")).Wait();
            connection.RunAsync(Query.Db("test").TableCreate("table2")).Wait();

            testTable = Query.Db("test").Table<TestObject>("table1");
            anotherTestTable = Query.Db("test").Table<AnotherTestObject>("table2");

            firstNameIndex = anotherTestTable.IndexDefine("index1", o => o.FirstName);
            connection.Run(firstNameIndex.IndexCreate());
            connection.Run(firstNameIndex.IndexWait());

            tagsIndex = testTable.IndexDefineMulti("indexTags", o => o.Tags);
            connection.Run(tagsIndex.IndexCreate());
            connection.Run(tagsIndex.IndexWait());
        }
开发者ID:jrote1,项目名称:rethinkdb-net,代码行数:18,代码来源:MultiTableTests.cs

示例4: TestFixtureSetUp

        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            connection.RunAsync(Query.DbCreate("test")).Wait();
            connection.RunAsync(Query.Db("test").TableCreate("table1")).Wait();
            connection.RunAsync(Query.Db("test").TableCreate("table2")).Wait();

            testTable = Query.Db("test").Table<TestObject>("table1");
            anotherTestTable = Query.Db("test").Table<AnotherTestObject>("table2");

            firstNameIndex = anotherTestTable.IndexDefine("index1", o => o.FirstName);
            connection.Run(firstNameIndex.IndexCreate());
            connection.Run(firstNameIndex.IndexWait()).ToArray(); // ToArray ensures that the IEnumerable is actually evaluated completely and the wait is completed

            tagsIndex = testTable.IndexDefineMulti("indexTags", o => o.Tags);
            connection.Run(tagsIndex.IndexCreate());
            connection.Run(tagsIndex.IndexWait()).ToArray(); // ToArray ensures that the IEnumerable is actually evaluated completely and the wait is completed
        }
开发者ID:nkreipke,项目名称:rethinkdb-net,代码行数:18,代码来源:MultiTableTests.cs

示例5: TestFixtureSetUp

        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            connection.Run(Query.DbCreate("test"));
            connection.Run(Query.Db("test").TableCreate("table"));

            testTable = Query.Db("test").Table<TestObject>("table");
            connection.Run(testTable.Insert(new TestObject[]
            {
                new TestObject() { Name = "1", SomeNumber = 1 },
                new TestObject() { Name = "1", SomeNumber = 1 },
                new TestObject() { Name = "2", SomeNumber = 2, Tags = new string[] { "A", "B" } },
                new TestObject() { Name = "2", SomeNumber = 200 },
                new TestObject() { Name = "2", SomeNumber = 2, Tags = new string[] { "A", "C" } },
                new TestObject() { Name = "3", SomeNumber = 3 },
                new TestObject() { Name = "3", SomeNumber = 3 },
                new TestObject() { Name = "4", SomeNumber = 4 },
                new TestObject() { Name = "5", SomeNumber = 5 },
                new TestObject() { Name = "6", SomeNumber = 6 },
                new TestObject() { Name = "6", SomeNumber = 6 },
                new TestObject() { Name = "7", SomeNumber = 7 },
            }));

            nameIndex = testTable.IndexDefine("name", to => to.Name);
            connection.Run(nameIndex.IndexCreate());
            connection.Run(nameIndex.IndexWait()).ToArray(); // ToArray ensures that the IEnumerable is actually evaluated completely and the wait is completed
        }
开发者ID:nkreipke,项目名称:rethinkdb-net,代码行数:27,代码来源:GroupingTests.cs

示例6: TestFixtureSetUp

        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            connection.Run(Query.DbCreate("test"));
            connection.Run(Query.Db("test").TableCreate("table"));

            testTable = Query.Db("test").Table<TestObject>("table");
            connection.Run(testTable.Insert(new TestObject[]
            {
                new TestObject() { Name = "1", SomeNumber = 1 },
                new TestObject() { Name = "1", SomeNumber = 1 },
                new TestObject() { Name = "2", SomeNumber = 2, Tags = new string[] { "A", "B" } },
                new TestObject() { Name = "2", SomeNumber = 200 },
                new TestObject() { Name = "2", SomeNumber = 2, Tags = new string[] { "A", "C" } },
                new TestObject() { Name = "3", SomeNumber = 3 },
                new TestObject() { Name = "3", SomeNumber = 3 },
                new TestObject() { Name = "4", SomeNumber = 4 },
                new TestObject() { Name = "5", SomeNumber = 5 },
                new TestObject() { Name = "6", SomeNumber = 6 },
                new TestObject() { Name = "6", SomeNumber = 6 },
                new TestObject() { Name = "7", SomeNumber = 7 },
            }));

            nameIndex = testTable.IndexDefine("name", to => to.Name);
            connection.Run(nameIndex.IndexCreate());
            connection.Run(nameIndex.IndexWait());
        }
开发者ID:jrote1,项目名称:rethinkdb-net,代码行数:27,代码来源:GroupingTests.cs


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