本文整理汇总了C#中IObjectContainer.Query方法的典型用法代码示例。如果您正苦于以下问题:C# IObjectContainer.Query方法的具体用法?C# IObjectContainer.Query怎么用?C# IObjectContainer.Query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IObjectContainer
的用法示例。
在下文中一共展示了IObjectContainer.Query方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RetrieveAllSensorReadoutsQuery
public static void RetrieveAllSensorReadoutsQuery(IObjectContainer db)
{
IQuery query = db.Query();
query.Constrain(typeof(SensorReadout));
IObjectSet result = query.Execute();
ListResult(result);
}
示例2: RetrieveAllPilots
public static void RetrieveAllPilots(IObjectContainer db)
{
IQuery query = db.Query();
query.Constrain(typeof(Pilot));
IObjectSet result = query.Execute();
ListResult(result);
}
示例3: OptimizedNativeQuery
private static void OptimizedNativeQuery(IObjectContainer container)
{
IList<Pilot> result = container.Query(
delegate(Pilot pilot) { return pilot.Name.StartsWith("J"); });
ListResult(result);
}
示例4: Query
public virtual IObjectSet Query(IObjectContainer db)
{
var query = db.Query();
query.Constrain(this);
query.Descend("_flag").Constrain(true).Not();
return query.Execute();
}
示例5: obtemNovoIdEng
private int obtemNovoIdEng()
{
try
{
db = ServidorSingleton.obterServidor().OpenClient();
IQuery query = db.Query();
query.Constrain(typeof(EngenheiroCampo)).Greater();
query.Descend("codigo").OrderDescending();
IObjectSet leitor = query.Execute();
if (leitor.HasNext())
{
EngenheiroCampo objEng = (EngenheiroCampo)leitor.Next();
leitor = null;
return Convert.ToInt32(objEng.Codigo) + 1;
}
else
{
leitor = null;
return 1;
}
}
catch (Exception ex)
{
throw new Exception("Erro obtendo o id do engenheiro :" + ex.ToString());
}
finally
{
db.Close();
db.Dispose();
}
}
示例6: IndexDatabase
private void IndexDatabase(IndexWriter writer, IObjectContainer container)
{
IEnumerable<Versiculo> versiculos = container.Query<Versiculo>();
foreach(Versiculo versiculo in versiculos){
Document doc = CreateVersiculoDoc(container.Ext().GetID(versiculo), versiculo);
writer.AddDocument(doc);
}
}
示例7: GetByName
private Item GetByName(IObjectContainer oc, string name)
{
var q = oc.Query();
q.Constrain(typeof (Item));
q.Descend("name").Constrain(name);
var objectSet = q.Execute();
return (Item) objectSet.Next();
}
示例8: QueryWithEvaluation
public static void QueryWithEvaluation(IObjectContainer db)
{
IQuery query = db.Query();
query.Constrain(typeof (Car));
query.Constrain(new EvenHistoryEvaluation());
IObjectSet result = query.Execute();
Util.ListResult(result);
}
示例9: ReadALot
private static void ReadALot(IObjectContainer container)
{
IList<DataObject> allObjects = container.Query<DataObject>();
foreach (DataObject obj in allObjects)
{
obj.ToString();
}
}
示例10: RunSODAQuery
private static IObjectSet RunSODAQuery(IObjectContainer db, SimpleEnum value)
{
IQuery query = db.Query();
query.Constrain(typeof(Container));
query.Descend("_simpleEnum").Constrain(value);
return query.Execute();
}
示例11: QueryItems
private IObjectSet QueryItems(IObjectContainer container)
{
var q = container.Query();
q.Constrain(typeof (Item));
q.Descend("value").OrderAscending();
var found = q.Execute();
return found;
}
示例12: QueryItems
private IObjectSet QueryItems(IObjectContainer container)
{
IQuery q = container.Query();
q.Constrain(typeof(LegacyDatabaseDefragTestCase.Item));
q.Descend("value").OrderAscending();
IObjectSet found = q.Execute();
return found;
}
示例13: RetrievePilotByExactPoints
public static void RetrievePilotByExactPoints(IObjectContainer db)
{
IQuery query = db.Query();
query.Constrain(typeof(Pilot));
query.Descend("_points").Constrain(100);
IObjectSet result = query.Execute();
ListResult(result);
}
示例14: RetrievePilotByName
public static void RetrievePilotByName(IObjectContainer db)
{
IQuery query = db.Query();
query.Constrain(typeof(Pilot));
query.Descend("_name").Constrain("Michael Schumacher");
IObjectSet result = query.Execute();
ListResult(result);
}
示例15: PrepareData
public void PrepareData()
{
container = Db4oEmbedded.OpenFile(DatabaseFile);
if (container.Query().Execute().Count == 0)
{
StoreTestData(container);
}
}