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


C# QueriableDummy.Where方法代码示例

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

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

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

示例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);
        }
开发者ID:gordonwatts,项目名称:LINQtoROOT,代码行数:34,代码来源:TTreeQueryExecutorTest.cs


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