Open introspection3 opened 5 years ago
and linq2db's advantage
In short. Pro:
Contra:
this could be mitigated using our linq2db with EF.Core integration https://github.com/linq2db/linq2db.EntityFrameworkCore
I think @to11mtm could provide more details later
Other Points (May be advantage or disadvantage depending on point of view)
Very close representation to what is actually happening at the Database Level. You'd be amazed at how easy it is to take a SQL Query you've written in Sql Server Management Studio or Oracle SQL Developer, and then translate it into a query with Linq2Db.
That somewhat ties to my next point; In EF, You typically have to consider 'how' EF works. While some consider EF's change tracking to be a feature, in many cases it is actually a detriment. My favorite example: Updating a single column on one or more entities in a single round trip. In Linq2Db this is simple: db.MyTable.Where(x=>x.ID==4).Set(s=>s.Cost,50).Update();
In EF you typically have to write a lot of tricky code around how the entity is attached and detached. Sure, you can drop to Entity-SQL or Raw SQL, but then what's the point of a Linq Provider? ;) This feature alone was what made me go from Dapper to being a huge proponent of Linq2Db.
Linq2Db is Very easy to extend with the [SqlFunction]
and [SqlExpression]
Attributes: these let you extend your syntax with functions that can be reused inside Linq queries. Some examples of this can be seen here but we will be adding more concise details to our main documentation shortly.
I'll probably add some more thoughts later. :)
Worth documenting?
hi,please vs entityframe work core