本文整理汇总了C#中IExtObjectContainer.QueryByExample方法的典型用法代码示例。如果您正苦于以下问题:C# IExtObjectContainer.QueryByExample方法的具体用法?C# IExtObjectContainer.QueryByExample怎么用?C# IExtObjectContainer.QueryByExample使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IExtObjectContainer
的用法示例。
在下文中一共展示了IExtObjectContainer.QueryByExample方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConcReadDifferentObject
/// <exception cref="System.Exception"></exception>
public virtual void ConcReadDifferentObject(IExtObjectContainer oc, int seq)
{
var example = new SimpleObject(testString + seq, seq);
var result = oc.QueryByExample(example);
Assert.AreEqual(1, result.Count);
Assert.AreEqual(example, result.Next());
}
示例2: ConcReadSameObject
/// <exception cref="System.Exception"></exception>
public virtual void ConcReadSameObject(IExtObjectContainer oc)
{
var mid = ThreadCount()/2;
var example = new SimpleObject(testString + mid, mid);
var result = oc.QueryByExample(example);
Assert.AreEqual(1, result.Count);
Assert.AreEqual(example, result.Next());
}
示例3: Check
public virtual void Check(IExtObjectContainer oc)
{
DeepSetTestCase example = new DeepSetTestCase();
example.name = "1";
DeepSetTestCase ds = (DeepSetTestCase)oc.QueryByExample(example).Next();
Assert.IsTrue(ds.child.name.StartsWith("12"));
Assert.IsTrue(ds.child.name.Length > "12".Length);
Assert.AreEqual("3", ds.child.child.name);
}
示例4: Conc
// db4o constructor
public virtual void Conc(IExtObjectContainer oc)
{
oc.QueryByExample((new Db4objects.Db4o.Tests.Common.Concurrency.QueryNonExistantTestCase
(true)));
AssertOccurrences(oc, typeof(Db4objects.Db4o.Tests.Common.Concurrency.QueryNonExistantTestCase
), 0);
IQuery q = oc.Query();
q.Constrain(new Db4objects.Db4o.Tests.Common.Concurrency.QueryNonExistantTestCase
(true));
Assert.AreEqual(0, q.Execute().Count);
}
示例5: Conc
public virtual void Conc(IExtObjectContainer oc, int seq)
{
DeepSetTestCase example = new DeepSetTestCase();
example.name = "1";
DeepSetTestCase ds = (DeepSetTestCase)oc.QueryByExample(example).Next();
Assert.AreEqual("1", ds.name);
Assert.AreEqual("3", ds.child.child.name);
ds.name = "1";
ds.child.name = "12" + seq;
ds.child.child.name = "13" + seq;
oc.Store(ds, 2);
}
示例6: Conc
public virtual void Conc(IExtObjectContainer oc)
{
Assert.AreEqual(2, oc.QueryByExample(null).Count);
}