本文整理汇总了C#中QueriableDummy.Where方法的典型用法代码示例。如果您正苦于以下问题:C# QueriableDummy.Where方法的具体用法?C# QueriableDummy.Where怎么用?C# QueriableDummy.Where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QueriableDummy
的用法示例。
在下文中一共展示了QueriableDummy.Where方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestTakeSkipLevelBurreidTwice
public void TestTakeSkipLevelBurreidTwice()
{
var q = new QueriableDummy<dummyntup>();
var c = q.Where(x => x.run > 10).Select(x => Tuple.Create(x.run, x.vals)).Select(x => x.Item2).SelectMany(x => x).Select(x => x + 1).Where(x => x > 10).Where(x => x > 5).Take(5).Count();
Assert.IsNotNull(DummyQueryExectuor.FinalResult, "Expecting some code to have been generated!");
var res = DummyQueryExectuor.FinalResult;
res.DumpCodeToConsole();
Assert.AreEqual(1, res.DumpCode().Where(l => l.Contains("static int")).Count());
}
示例2: TestTakeSkipAtTopLevelBurreidTwice
public void TestTakeSkipAtTopLevelBurreidTwice()
{
var q = new QueriableDummy<ntup>();
var c = q.Where(x => x.run > 10).Where(x => x.run > 20).Take(5).Count();
Assert.IsNotNull(DummyQueryExectuor.FinalResult, "Expecting some code to have been generated!");
var res = DummyQueryExectuor.FinalResult;
res.DumpCodeToConsole();
Assert.AreEqual(1, res.DumpCode().Where(l => l.Contains("static int")).Count());
}
示例3: TestTakeSkipLevelInFromExpression
public void TestTakeSkipLevelInFromExpression()
{
var q = new QueriableDummy<dummyntup>();
var c1 = from evt in q.Where(x => x.run > 10).Take(5).SelectMany(x => x.valC1D)
where evt > 50
select evt;
var c = c1.Count();
Assert.IsNotNull(DummyQueryExectuor.FinalResult, "Expecting some code to have been generated!");
var res = DummyQueryExectuor.FinalResult;
Console.WriteLine(DummyQueryExectuor.LastQueryModel.ToString());
res.DumpCodeToConsole();
Assert.AreEqual(1, res.DumpCode().Where(l => l.Contains("static int")).Count());
}
示例4: TestDualQueryOnSameQueriable
public void TestDualQueryOnSameQueriable()
{
var rootFile = TestUtils.CreateFileOfInt(5);
///
/// Generate a proxy .h file that we can use
///
var proxyFile = TestUtils.GenerateROOTProxy(rootFile, "dude");
///
/// Get a simple query we can "play" with
///
var q = new QueriableDummy<TestNtupe>();
var dude = q.Count();
var query = DummyQueryExectuor.LastQueryModel;
///
/// Ok, now we can actually see if we can make it "go".
///
ntuple._gProxyFile = proxyFile.FullName;
var exe = new TTreeQueryExecutor(new[] { rootFile }, "dude", typeof(ntuple), typeof(TestNtupe));
int result = exe.ExecuteScalar<int>(query);
///
/// Run the second one now
///
var dude1 = q.Where(e => e.run > 10).Count();
query = DummyQueryExectuor.LastQueryModel;
result = exe.ExecuteScalar<int>(query);
}