Example #1
0
 public void generalSort(isGreater greaterAction)
 {
     for (int i = 0; i < _employees.Count; i++)
     {
         for (int j = 0; j < _employees.Count - 1; j++)
         {
             if (greaterAction(_employees[j], _employees[j + 1]))
             {
                 var tmp = _employees[j];
                 _employees[j]     = _employees[j + 1];
                 _employees[j + 1] = tmp;
             }
         }
     }
 }
Example #2
0
        static void Main(string[] args)
        {
            isGreater g1 = (a, b) =>
            {
                if (a > b)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            };

            Console.WriteLine(g1(40, 30));

            Console.ReadLine();
        }