csharp 谓词演示

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了csharp 谓词演示相关的知识,希望对你有一定的参考价值。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;

namespace Predicate
{
    class Program
    {
        public static void Main()
        {
            // Create an array of Point structures.
            Point[] points = { new Point(100, 200),
                         new Point(150, 250), new Point(250, 375),
                         new Point(275, 395), new Point(295, 450) };

            // Define the Predicate<T> delegate.
            Predicate<Point> predicate = FindPoints;

            // Find the first Point structure for which X times Y  
            // is greater than 100000. 
            Point first = Array.Find(points, predicate);
            Point[] pointall = Array.FindAll(points, predicate);

            // Display the first structure found.
            Console.WriteLine("Found: X = {0}, Y = {1}", first.X, first.Y);
        }

        private static bool FindPoints(Point obj)
        {
            return obj.X * obj.Y > 100000;
        }
    }
}

以上是关于csharp 谓词演示的主要内容,如果未能解决你的问题,请参考以下文章

csharp RestSharp演示

csharp AutoMapper 6.0演示

csharp linq演示

csharp 动态Expando演示

csharp 参考演示

csharp SharePointGetList演示