3 ms·
Iirc, Linq is exactly a query builder and not an orm. IMO what truly makes an orm is when object fields have data binding against the database (updating a fiel
by throwawaymaths 3y ago
Iirc, Linq is exactly a query builder and not an orm. IMO what truly makes an orm is when object fields have data binding against the database (updating a field triggers an update in the db)
It's kinda gross because the developer needs to make a decision about what is authoritative source of truth, the programming model makes you feel like you can trust your code (probably the wrong choice), and all the footguns around distributed state kick in (possibly even worse if you have a frontend with two way data binding and data structures that last longer than an http request in your backend)
- geraldwhen 3y agoTypeORM thinks it’s an ORM but it doesn’t do what you say. It’s pretty good at writing basic migrations from annotations, but that’s about it.
- scarface_74 3y agoLINQ 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.
- throwawaymaths 3y agoClarifying: ORMs are gross, query builders are not.