本文整理汇总了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());
}
示例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
}
示例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());
}
示例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
}
示例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
}
示例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());
}