Using Lambda Expression in FindAll()

I got a critical comment from @amazedsaint.  You can read his blog

If you read my previous post, I am using a method GreaterThanHun As predicate to pass as parameter to FindAll().

Instead of that we can use 
  1. Anonymous method 
  2. Lambda expression 
So, I am going to show you here how we could use Lambda expression 

So here we are just writing a lambda instead of calling a function. 


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication24
    class Program
        static void Main(string[] args)
            List<int> lst = new List<int>();
            List<int> lstgrthund = lst.FindAll(a=>a>100? true:false);
            foreach (var r in lstgrthund)


Similar Articles