Last active
October 23, 2017 19:26
-
-
Save alieniasty/2cd63bbb37880ecc89a2a349ab062351 to your computer and use it in GitHub Desktop.
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
An expression simply turns a delegate into a data about itself. So a => a + 1 becomes something like "On the left side there's an int a. On the right side you add 1 to it." | |
That's it. You can go home now. Expression allows you to look inside the delegate and see everything it's wanting to do, empowering you to translate it into whatever you want, like a SQL query. | |
Func for example won't work for DbContext above because DbContext itself is blind to what is actually in the lambda expression and will not turn it into SQL, so it will do the next best thing and will iterate that conditional through each row in the table. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment