square is assigned the lambda expression x = > x * x:

image_pdfimage_print
   
 

using System;
delegate int Transformer(int i);

class Test {
    static void Main() {
        Transformer square = x => x * x;
        Console.WriteLine(square(3));    // 9
    }
}

    


This entry was posted in LINQ. Bookmark the permalink.