On Jan 31, 8:18 am, "Tem" <tem1...@yahoo.comwrote:
Wouldn't it be better performance, if there was an option to specify what db
server you're running so the compiler can generate the exact queries you
need and not waste cpu cycles at runtime?
No. The compiler is a C# compiler, it doesn't know anything about SQL.
That's the best way to keep the separation clean. Don't forget that
LINQ isn't limited to SQL - it could be talking to LDAP, or SharePoint
etc.
You can ask LINQ to SQL to compile queries for you once, which doesn't
actually take very much time - you're losing very, very little by
doing it at execution time, and gaining a lot more flexibility, while
keeping the language compiler and the LINQ providers at arm's length
from each other.
Jon