2 ms·
LINQ is a query builder and the .Net runtime creates expression trees. Entity Framework translates the expression tree to SQL and maps data back to objects.
by scarface_74 3y ago
LINQ is a query builder and the .Net runtime creates expression trees. Entity Framework translates the expression tree to SQL and maps data back to objects.
- throwawaymaths 3y agoAnd iirc you can use databases in .net with Linq only and pass on entity framework, if you so chose
- scarface_74 3y agoLinq2SQL was a thing. I’m not even sure if it is still supported.
- Merad 3y agoLinq is really just a high level abstraction for querying any data that can be queried. EF adds some more abstractions mostly related to mapping C# objects to database tables. Then it adds database specific query providers (implementations) that combine the (abstract) linq query and the mapping to produce sql. You can really use linq to query anything (APIs, for example), including databases without using EF. It's just not very common because building a custom query provider is a lot of work.