Created
January 22, 2016 09:20
-
-
Save Fosna/a047fc28e8c216f44c7c to your computer and use it in GitHub Desktop.
It's suggested to use LINQPad 5 (download link: http://www.linqpad.net/download.aspx). See what's the difference between lambda delegate and lambda expression tree.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Func<int, int, int> addDel = (a, b) => a + b; | |
Console.WriteLine(addDel); | |
int d = addDel(1, 2); | |
Console.WriteLine(d); | |
Expression<Func<int, int, int>> addExp = (a, b) => a + b; | |
Console.WriteLine(addExp); | |
addExp(1,2); | |
Func<int, int, int> addCompiled = addExp.Compile(); | |
Console.WriteLine(addCompiled); | |
int c = addCompiled(1, 2); | |
Console.WriteLine(c); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment