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


C# IExtObjectContainer.Query方法代码示例

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


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

示例1: Conc

		public virtual void Conc(IExtObjectContainer oc)
		{
			IQuery q = oc.Query();
			q.Constrain(typeof(Db4objects.Db4o.Tests.Common.Concurrency.QueryForUnknownFieldTestCase
				));
			q.Descend("_name").Constrain("name");
			Assert.AreEqual(1, q.Execute().Count);
			q = oc.Query();
			q.Constrain(typeof(Db4objects.Db4o.Tests.Common.Concurrency.QueryForUnknownFieldTestCase
				));
			q.Descend("name").Constrain("name");
			Assert.AreEqual(0, q.Execute().Count);
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:13,代码来源:QueryForUnknownFieldTestCase.cs

示例2: Conc

 public virtual void Conc(IExtObjectContainer oc)
 {
     var q = oc.Query();
     q.Constrain(typeof (QueryForUnknownFieldTestCase
         ));
     q.Descend("_name").Constrain("name");
     Assert.AreEqual(1, q.Execute().Count);
     q = oc.Query();
     q.Constrain(typeof (QueryForUnknownFieldTestCase
         ));
     q.Descend("name").Constrain("name");
     Assert.AreEqual(0, q.Execute().Count);
 }
开发者ID:masroore,项目名称:db4o,代码行数:13,代码来源:QueryForUnknownFieldTestCase.cs

示例3: AssertDateTimeQuery

 private void AssertDateTimeQuery(IExtObjectContainer objectContainer, DateTime value)
 {
     IQuery query = objectContainer.Query();
     query.Constrain(typeof (Item));
     query.Descend("_dateTime").Constrain(value);
     Assert.AreEqual(1, query.Execute().Count);
 }
开发者ID:superyfwy,项目名称:db4o,代码行数:7,代码来源:IndexedDateTimeUpdateTestCase.cs

示例4: Conc

		public virtual void Conc(IExtObjectContainer oc)
		{
			int[] expect = new int[] { 3, 4, 5 };
			IQuery q = oc.Query();
			q.Constrain(typeof(Db4objects.Db4o.Tests.Common.Concurrency.GreaterOrEqualTestCase
				));
			q.Descend("val").Constrain(3).Greater().Equal();
			IObjectSet res = q.Execute();
			while (res.HasNext())
			{
				Db4objects.Db4o.Tests.Common.Concurrency.GreaterOrEqualTestCase r = (Db4objects.Db4o.Tests.Common.Concurrency.GreaterOrEqualTestCase
					)res.Next();
				for (int i = 0; i < expect.Length; i++)
				{
					if (expect[i] == r.val)
					{
						expect[i] = 0;
					}
				}
			}
			for (int i = 0; i < expect.Length; i++)
			{
				Assert.AreEqual(0, expect[i]);
			}
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:25,代码来源:GreaterOrEqualTestCase.cs

示例5: ConcReadDifferentObject

		/// <exception cref="System.Exception"></exception>
		public virtual void ConcReadDifferentObject(IExtObjectContainer oc, int seq)
		{
			SimpleObject expected = new SimpleObject(testString + seq, seq);
			IObjectSet result = oc.Query(new ReadObjectNQTestCase.MyPredicate(expected));
			Assert.AreEqual(1, result.Count);
			Assert.AreEqual(expected, result.Next());
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:8,代码来源:ReadObjectNQTestCase.cs

示例6: Conc

		/// <exception cref="System.Exception"></exception>
		public virtual void Conc(IExtObjectContainer oc)
		{
			IObjectSet os = oc.Query(typeof(InvalidUUIDTestCase));
			if (os.Count == 0)
			{
				// already deleted by other threads
				return;
			}
			Assert.AreEqual(1, os.Count);
			InvalidUUIDTestCase iu = (InvalidUUIDTestCase)os.Next();
			Db4oUUID myUuid = oc.GetObjectInfo(iu).GetUUID();
			Assert.IsNotNull(myUuid);
			byte[] mySignature = myUuid.GetSignaturePart();
			long myLong = myUuid.GetLongPart();
			long unknownLong = long.MaxValue - 100;
			byte[] unknownSignature = new byte[] { 1, 2, 4, 99, 33, 22 };
			Db4oUUID unknownLongPart = new Db4oUUID(unknownLong, mySignature);
			Db4oUUID unknownSignaturePart = new Db4oUUID(myLong, unknownSignature);
			Db4oUUID unknownBoth = new Db4oUUID(unknownLong, unknownSignature);
			Assert.IsNull(oc.GetByUUID(unknownLongPart));
			Assert.IsNull(oc.GetByUUID(unknownSignaturePart));
			Assert.IsNull(oc.GetByUUID(unknownBoth));
			Assert.IsNull(oc.GetByUUID(unknownLongPart));
			Thread.Sleep(500);
			oc.Delete(iu);
			oc.Commit();
			Assert.IsNull(oc.GetByUUID(myUuid));
		}
开发者ID:erdincay,项目名称:db4o,代码行数:29,代码来源:InvalidUUIDTestCase.cs

示例7: Conc

		public virtual void Conc(IExtObjectContainer oc)
		{
			IQuery q = oc.Query();
			q.Constrain(this.GetType());
			IObjectSet res = q.Execute();
			Assert.AreEqual(Count, res.Count);
			long[] ids1 = new long[res.Count];
			int i = 0;
			while (res.HasNext())
			{
				ids1[i++] = oc.GetID(res.Next());
			}
			res.Reset();
			long[] ids2 = res.Ext().GetIDs();
			Assert.AreEqual(Count, ids1.Length);
			Assert.AreEqual(Count, ids2.Length);
			for (int j = 0; j < ids1.Length; j++)
			{
				bool found = false;
				for (int k = 0; k < ids2.Length; k++)
				{
					if (ids1[j] == ids2[k])
					{
						found = true;
						break;
					}
				}
				Assert.IsTrue(found);
			}
		}
开发者ID:erdincay,项目名称:db4o,代码行数:30,代码来源:ObjectSetIDsTestCase.cs

示例8: QueryContains

 private IObjectSet QueryContains(IExtObjectContainer oc, string str)
 {
     var q = oc.Query();
     q.Constrain(typeof (ParameterizedEvaluationTestCase));
     q.Constrain(new MyEvaluation(str));
     return q.Execute();
 }
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:ParameterizedEvaluationTestCase.cs

示例9: Conc1

		/// <exception cref="System.Exception"></exception>
		public virtual void Conc1(IExtObjectContainer oc)
		{
			IObjectSet os = oc.Query(typeof(DualDeleteTestCase.Item));
			Thread.Sleep(500);
			DeleteObjectSet(oc, os);
			oc.Rollback();
		}
开发者ID:Galigator,项目名称:db4o,代码行数:8,代码来源:DualDeleteTestCase.cs

示例10: Conc

 public virtual void Conc(IExtObjectContainer oc)
 {
     int[] expect = {3, 4, 5};
     var q = oc.Query();
     q.Constrain(typeof (GreaterOrEqualTestCase
         ));
     q.Descend("val").Constrain(3).Greater().Equal();
     var res = q.Execute();
     while (res.HasNext())
     {
         var r = (GreaterOrEqualTestCase
             ) res.Next();
         for (var i = 0; i < expect.Length; i++)
         {
             if (expect[i] == r.val)
             {
                 expect[i] = 0;
             }
         }
     }
     for (var i = 0; i < expect.Length; i++)
     {
         Assert.AreEqual(0, expect[i]);
     }
 }
开发者ID:masroore,项目名称:db4o,代码行数:25,代码来源:GreaterOrEqualTestCase.cs

示例11: ConcQueryCaseInsenstive

 public virtual void ConcQueryCaseInsenstive(IExtObjectContainer oc)
 {
     var q = oc.Query();
     q.Constrain(typeof (CaseInsensitiveTestCase
         ));
     q.Constrain(new CaseInsensitiveEvaluation("helloworld"));
     Assert.AreEqual(1, q.Execute().Count);
 }
开发者ID:masroore,项目名称:db4o,代码行数:8,代码来源:CaseInsensitiveTestCase.cs

示例12: ConcQueryCaseInsenstive

		public virtual void ConcQueryCaseInsenstive(IExtObjectContainer oc)
		{
			IQuery q = oc.Query();
			q.Constrain(typeof(Db4objects.Db4o.Tests.Common.Concurrency.CaseInsensitiveTestCase
				));
			q.Constrain(new CaseInsensitiveTestCase.CaseInsensitiveEvaluation("helloworld"));
			Assert.AreEqual(1, q.Execute().Count);
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:8,代码来源:CaseInsensitiveTestCase.cs

示例13: Check2

		public virtual void Check2(IExtObjectContainer oc)
		{
			IQuery q = oc.Query();
			q.Constrain(typeof(MultiLevelIndexTestCase));
			q.Descend("_child").Descend("_i").Constrain(-200).Smaller();
			IObjectSet objectSet = q.Execute();
			Assert.AreEqual(ThreadCount(), objectSet.Count);
		}
开发者ID:Galigator,项目名称:db4o,代码行数:8,代码来源:MultiLevelIndexTestCase.cs

示例14: ConcReadSameObject

		/// <exception cref="System.Exception"></exception>
		public virtual void ConcReadSameObject(IExtObjectContainer oc)
		{
			int mid = ThreadCount() / 2;
			SimpleObject expected = new SimpleObject(testString + mid, mid);
			IObjectSet result = oc.Query(new ReadObjectNQTestCase.MyPredicate(expected));
			Assert.AreEqual(1, result.Count);
			Assert.AreEqual(expected, result.Next());
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:9,代码来源:ReadObjectNQTestCase.cs

示例15: QuerySpecificObjects

		private static IObjectSet QuerySpecificObjects(IExtObjectContainer objectContainer)
		{
			var query = objectContainer.Query();
			query.Constrain(typeof (Item));
			query.Descend("value").Constrain(42);

			return query.Execute();
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:8,代码来源:HandlerVersionWhenSeekingToFieldTestCase.cs


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