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


C# QueriableDummy.Select方法代码示例

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


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

示例1: PrettyPrintSimpleQuery

        public void PrettyPrintSimpleQuery()
        {
            var q = new QueriableDummy<ntup>();

            var r = q.Select(rq => rq.run * 2).PrettyPrintQuery();
            Console.WriteLine(r);
            Assert.IsTrue(r.Contains("select"));
            Assert.IsTrue(r.Contains("[rq].run * 2"));
        }
开发者ID:gordonwatts,项目名称:LINQtoROOT,代码行数:9,代码来源:HelpersTest.cs

示例2: PrettyPrintHideTuples

        public void PrettyPrintHideTuples()
        {
            var q = new QueriableDummy<ntup>();

            var r = q.Select(rq => Tuple.Create(rq.run * 2, 1)).Select(rq => rq.Item1).PrettyPrintQuery();
            Console.WriteLine(r);
            Assert.IsFalse(r.Contains("Tuple"));
            Assert.IsTrue(r.Contains("[rq].run * 2"));

        }
开发者ID:gordonwatts,项目名称:LINQtoROOT,代码行数:10,代码来源:HelpersTest.cs

示例3: CacheObjectWhenCPPChanges

        public void CacheObjectWhenCPPChanges()
        {
            TestUtils.ResetLINQLibrary();
            // Make sure that when the C++ code changes, the cache key for lookup of results will also change.
            var q = new QueriableDummy<ntup>();
            var i = q.Select(e => DoItClass.DoIt(e.run)).Where(x => x > 2).Count();
            var query = DummyQueryExectuor.LastQueryModel;

            // Look for a hash value.
            var str1 = FormattingQueryVisitor.Format(query);
            Console.WriteLine(str1);
            var m = Regex.Match(str1, @"DoIt([^\(]+)");
            Assert.IsTrue(m.Success);
        }
开发者ID:gordonwatts,项目名称:LINQtoROOT,代码行数:14,代码来源:TypeHandlerCPPCodeTest.cs

示例4: QueryTupleWithBadType

 /// <summary>
 /// Generate a tree against a byte, a type that we don't currently support.
 /// </summary>
 private static void QueryTupleWithBadType()
 {
     var q = new QueriableDummy<singleIntNtuple>();
     q
         .Select(e => new customObjectWithByte() { Var1 = (byte)(e.run + 1) })
         .AsTTree("DataTree", "not going to happen", null, "c1", "c2");
 }
开发者ID:gordonwatts,项目名称:LINQtoROOT,代码行数:10,代码来源:AsTTreeTest.cs

示例5: QueryTupleOurCustomObjectTitleAndNameDefaultFile

 /// <summary>
 /// Simple query for a customized object.
 /// </summary>
 private static void QueryTupleOurCustomObjectTitleAndNameDefaultFile()
 {
     var q = new QueriableDummy<singleIntNtuple>();
     q
         .Select(e => new ourCustomObject() { col1 = e.run, col2 = (int)e.run + 1, col3 = e.run + 2 })
         .AsTTree("PhysicsTree", "Data that we've written for a physics tree");
 }
开发者ID:gordonwatts,项目名称:LINQtoROOT,代码行数:10,代码来源:AsTTreeTest.cs

示例6: QueryTupleAllTypes

 /// <summary>
 /// Generage a query that fills all variable type.
 /// </summary>
 private static void QueryTupleAllTypes()
 {
     var q = new QueriableDummy<singleIntNtuple>();
     q
         .Select(e => new customObjectAllValidTypes() { vDouble = (double)e.run, vBool = e.run == 10, vInt = (int)e.run })
         .AsTTree(outputROOTFile: new FileInfo("allguys.root"));
 }
开发者ID:gordonwatts,项目名称:LINQtoROOT,代码行数:10,代码来源:AsTTreeTest.cs

示例7: QueryTupleOurCustomObjectCustomLeafNames

 /// <summary>
 /// Reset the leaf names
 /// </summary>
 private static void QueryTupleOurCustomObjectCustomLeafNames()
 {
     var q = new QueriableDummy<singleIntNtuple>();
     q
         .Select(e => new ourCustomObject() { col1 = e.run, col2 = (int)e.run + 1, col3 = e.run + 2 })
         .AsTTree("DataTree", "this is a test", null, "c1", "c2");
 }
开发者ID:gordonwatts,项目名称:LINQtoROOT,代码行数:10,代码来源:AsTTreeTest.cs

示例8: QueryTupleAnonyoumsObject

 /// <summary>
 /// Create a query with an anonymous object.
 /// </summary>
 private static void QueryTupleAnonyoumsObject()
 {
     var q = new QueriableDummy<singleIntNtuple>();
     q
         .Select(e => new { col2 = (int)e.run + 1, col3 = e.run + 2, col1 = e.run})
         .AsTTree(outputROOTFile: new FileInfo("hi.root"));
 }
开发者ID:gordonwatts,项目名称:LINQtoROOT,代码行数:10,代码来源:AsTTreeTest.cs

示例9: QueryTupleOurCustomObjectMissingVar

 /// <summary>
 /// We forget to initalize a varaible. Use to make sure the system gives a good
 /// error so the user can figure out what is going on.
 /// </summary>
 private static void QueryTupleOurCustomObjectMissingVar()
 {
     var q = new QueriableDummy<singleIntNtuple>();
     q
         .Select(e => new ourCustomObject() { col2 = (int)e.run + 1, col3 = e.run + 2 })
         .AsTTree(outputROOTFile: new FileInfo("hi.root"));
 }
开发者ID:gordonwatts,项目名称:LINQtoROOT,代码行数:11,代码来源:AsTTreeTest.cs

示例10: CacheWhenIncludesChange

        public void CacheWhenIncludesChange()
        {
            // Make sure that when the C++ code changes, the cache key for lookup of results will also change.
            var q = new QueriableDummy<ntup>();
            var mym = new MyModifiableCode();
            mym.LOC = new string[] { "int i = 0;", "MultBy2 = 10;" };
            var i = q.Select(e => mym.MultBy2(e.run)).Where(x => x > 2).Count();
            var query = DummyQueryExectuor.LastQueryModel;

            // Set the LOC to something.
            mym.Includes = new string[] { "TMVAReader.h" };
            var str1 = FormattingQueryVisitor.Format(query);
            mym.Includes = new string[] { "TFile.h" };
            var str2 = FormattingQueryVisitor.Format(query);
            Console.WriteLine(str1);
            Console.WriteLine(str2);
            Assert.AreNotEqual(str1, str2);
        }
开发者ID:gordonwatts,项目名称:LINQtoROOT,代码行数:18,代码来源:TypeHandlerOnTheFlyCPPTest.cs

示例11: BadObjectMultBy2

        public void BadObjectMultBy2()
        {
            // An end-to-end code test to see if we can generate code to multiply by 2.
            var q = new QueriableDummy<ntup>();

            var mym = new MyBrokenCode();
            var i = q.Select(e => mym.MultBy2(e.run)).Where(x => x > 2).Count();
        }
开发者ID:gordonwatts,项目名称:LINQtoROOT,代码行数:8,代码来源:TypeHandlerOnTheFlyCPPTest.cs

示例12: SimpleMultBy2

        public void SimpleMultBy2()
        {
            // An end-to-end code test to see if we can generate code to multiply by 2.
            var q = new QueriableDummy<ntup>();

            var mym = new MyCode();
            var i = q.Select(e => mym.MultBy2(e.run)).Where(x => x > 2).Count();

            DummyQueryExectuor.FinalResult.DumpCodeToConsole();
            Assert.IsTrue(DummyQueryExectuor.FinalResult.DumpCode().Where(l => l.Contains("*2")).Any());
        }
开发者ID:gordonwatts,项目名称:LINQtoROOT,代码行数:11,代码来源:TypeHandlerOnTheFlyCPPTest.cs


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