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


C# IObjectContainer.Query方法代码示例

本文整理汇总了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);
 }
开发者ID:superyfwy,项目名称:db4o,代码行数:7,代码来源:InheritanceExample.cs

示例2: RetrieveAllPilots

 public static void RetrieveAllPilots(IObjectContainer db)
 {
     IQuery query = db.Query();
     query.Constrain(typeof(Pilot));
     IObjectSet result = query.Execute();
     ListResult(result);
 }
开发者ID:erdincay,项目名称:db4o,代码行数:7,代码来源:QueryExample.cs

示例3: OptimizedNativeQuery

        private static void OptimizedNativeQuery(IObjectContainer container)
        {
            IList<Pilot> result = container.Query(
                delegate(Pilot pilot) { return pilot.Name.StartsWith("J"); });

            ListResult(result);
        }
开发者ID:Galigator,项目名称:db4o,代码行数:7,代码来源:NativeQueryDiagnostics.cs

示例4: Query

 public virtual IObjectSet Query(IObjectContainer db)
 {
     var query = db.Query();
     query.Constrain(this);
     query.Descend("_flag").Constrain(true).Not();
     return query.Execute();
 }
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:ConjunctiveQbETestCase.cs

示例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();
            }
        }
开发者ID:fbsharp,项目名称:Projetos,代码行数:32,代码来源:AdministradorDAO.cs

示例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); 
     }
 }
开发者ID:abibliafalada,项目名称:abibliafalada-v2,代码行数:8,代码来源:Index.cs

示例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();
 }
开发者ID:masroore,项目名称:db4o,代码行数:8,代码来源:RefreshTestCase.cs

示例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);
		}
开发者ID:erdincay,项目名称:db4o,代码行数:8,代码来源:EvaluationExample.cs

示例9: ReadALot

 private static void ReadALot(IObjectContainer container)
 {
     IList<DataObject> allObjects = container.Query<DataObject>();
     foreach (DataObject obj in allObjects)
     {
         obj.ToString();
     }
 }
开发者ID:Galigator,项目名称:db4o,代码行数:8,代码来源:CSMonitoring.cs

示例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();
		}
开发者ID:Galigator,项目名称:db4o,代码行数:8,代码来源:Db4oTest.cs

示例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;
 }
开发者ID:masroore,项目名称:db4o,代码行数:8,代码来源:LegacyDatabaseDefragTestCase.cs

示例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;
		}
开发者ID:erdincay,项目名称:db4o,代码行数:8,代码来源:LegacyDatabaseDefragTestCase.cs

示例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);
 }
开发者ID:erdincay,项目名称:db4o,代码行数:8,代码来源:QueryExample.cs

示例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);
 }
开发者ID:erdincay,项目名称:db4o,代码行数:8,代码来源:QueryExample.cs

示例15: PrepareData

 public void PrepareData()
 {
     container = Db4oEmbedded.OpenFile(DatabaseFile);
     if (container.Query().Execute().Count == 0)
     {
         StoreTestData(container);
     }
 }
开发者ID:Galigator,项目名称:db4o,代码行数:8,代码来源:GoodPerformance.cs


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