本文整理汇总了C#中Storage.CreateFieldIndex方法的典型用法代码示例。如果您正苦于以下问题:C# Storage.CreateFieldIndex方法的具体用法?C# Storage.CreateFieldIndex怎么用?C# Storage.CreateFieldIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Storage
的用法示例。
在下文中一共展示了Storage.CreateFieldIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Root
public Root(Storage db)
: base(db)
{
dates = db.CreateFieldIndex<DateTime, Record>("date", false);
services = db.CreateFieldIndex<String, Record>("service", false);
ids = db.CreateFieldIndex<String, Record>("id", false);
}
示例2: Open
/// <summary>Open database</summary>
/// <param name="filePath">path to the database file</param>
public void Open(string filePath)
{
db = StorageFactory.Instance.CreateStorage();
db.Open(filePath);
root = (DatabaseRoot)db.Root;
if (root == null)
{
root = new DatabaseRoot();
root.prefixUriIndex = db.CreateIndex(typeof(string), true);
root.suffixUriIndex = db.CreateIndex(typeof(string), true);
root.strPropIndex = db.CreateIndex(new Type[]{typeof(PropDef), typeof(string)}, false);
root.numPropIndex = db.CreateIndex(new Type[]{typeof(PropDef), typeof(double)}, false);
root.refPropIndex = db.CreateIndex(new Type[]{typeof(PropDef), typeof(VersionHistory)}, false);
root.timePropIndex = db.CreateIndex(new Type[]{typeof(PropDef), typeof(DateTime)}, false);
root.propDefIndex = db.CreateFieldIndex(typeof(PropDef), "name", true);
root.timeIndex = db.CreateFieldIndex(typeof(Thing), "timestamp", false);
root.inverseIndex = db.CreateIndex(typeof(string), false);
root.spatialIndex = db.CreateSpatialIndexR2();
root.latest = db.CreateSet();
CreateMetaType();
db.Root = root;
}
}