Last active
August 29, 2015 14:08
-
-
Save FransBouma/8403b388aa30d3207be2 to your computer and use it in GitHub Desktop.
How in-memory .net calls are in-lined in the final query in LLBLGen Pro's linq provider
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
var q = ctx.Customers.Select(c=>new Customer() { CompName = SomeMethod(c.CompanyName)}); | |
-> visit the select lambda, and convert it so it becomes: | |
(values, indices) => new Customer() { CompName = SomeMethod(values[indices[0]])}; | |
then compile the lambda. At projection time, execute the lambda with the object[] obtained from the datareader as 'values' | |
and a set of indices, one for each db value placed in the project. This way you can have any in-memory call in the projection | |
doing any code, without complicated conversions. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment