sashomaga

Lambda delegate empty

Feb 25th, 2013
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.39 KB | None | 0 0
  1. static void Main()
  2.     {
  3.  
  4.         Func<bool> test = () => true;
  5.         if (test())
  6.         {
  7.             Console.WriteLine(true);
  8.         }
  9.         else
  10.         {
  11.             Console.WriteLine(false);
  12.         }
  13.  
  14.         Func<int, bool> test2 = (x) => x < 10;
  15.         if (test2(6))
  16.         {
  17.             //6 < 10
  18.         }
  19.         else
  20.         {
  21.             //6 > 10
  22.         }
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment