I’m curious how exactly the Enity Framework integrates with LINQ in order to generate SQL statements to run against the database.
So lets say I have my own custom collection object. How do you integrate that object with LINQ to generate SQL statements?
If you wanted to make your own collection that created SQL statements, then what you would do is to have your collection class implement the
IQueryableinterface. As part of this interface, when the Linq expression is executed, the .NET framework will pass a Linq Expression Tree to your custom implementation of IQueryable. Your code would then parse this expression tree, and generate the SQL as needed, or do whatever other actions are needed, and return the result.Edit: Adding Links