LINQ to SQL always converts values into query parameters in the output. For example:
someTable.Where(n => n.Field == 5);
produces:
WHERE Field = @p0
This causes problems on certain query optimization scenarios. Is there a way to force values to be inlined in generated SQL, so that it becomes:
WHERE Field = 5
? Would LINQ to Entities provide a way or does it behave the same?
As Diego Vega from Entity Framework team mentioned on Twitter:
constants have actually translated as inline constants in EF forever.
so it seems like EF is the way to go, with one catch:
We believe EF7 should parameterize more so we need to hear when that is a bad for you
at least EF6 is much better than LINQ to SQL in that manner so we can use EF instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With