Why LINQ Sucks Today.
-
Natively it only has one 'join' operator, the equijoin, or inner join. A left or right join requires a subquery, and I don't want (today) to contemplate a full outer join.
I am still trying to find time to work through the LINQ book I bought a year ago. I think it looks cool, but I've not had the time to really get into it.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
I am still trying to find time to work through the LINQ book I bought a year ago. I think it looks cool, but I've not had the time to really get into it.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
It is, like, totally cool, man! It really is - I bemoaned the lack of a left join, but it is too flexible to confine anything to a built in function, over a more functional operation that is based on joining to null objects. For me one of the coolest is that I can join a DB table to an Array etc. I am trying to eliminate absolutely all data access code from all my projects now.
-
It is, like, totally cool, man! It really is - I bemoaned the lack of a left join, but it is too flexible to confine anything to a built in function, over a more functional operation that is based on joining to null objects. For me one of the coolest is that I can join a DB table to an Array etc. I am trying to eliminate absolutely all data access code from all my projects now.
Haven't played with linq at all yet, the one thing that scares me is that I can't quickly see what gets done by the DB and what gets bluntly loaded into the .NET world and filtered there.
Wout
-
Natively it only has one 'join' operator, the equijoin, or inner join. A left or right join requires a subquery, and I don't want (today) to contemplate a full outer join.
Brady Kelly wrote:
Natively it only has one 'join' operator, the equijoin, or inner join.
Nope, you just need to know how to do it. Tip:
DefaultIfEmpty()
xacc.ide
IronScheme - 1.0 RC 1 - out now!
((λ (x) `(,x ',x)) '(λ (x) `(,x ',x))) The Scheme Programming Language – Fourth Edition -
Haven't played with linq at all yet, the one thing that scares me is that I can't quickly see what gets done by the DB and what gets bluntly loaded into the .NET world and filtered there.
Wout
I don't know off-hand, but there is a readily accessible tool to reveal the DB query. Things like filtering definitely get delegated to the DB.
-
Brady Kelly wrote:
Natively it only has one 'join' operator, the equijoin, or inner join.
Nope, you just need to know how to do it. Tip:
DefaultIfEmpty()
xacc.ide
IronScheme - 1.0 RC 1 - out now!
((λ (x) `(,x ',x)) '(λ (x) `(,x ',x))) The Scheme Programming Language – Fourth Editionleppie wrote:
Tip: DefaultIfEmpty()
Not available in Entity Framework. I have been doing some homework. :)
-
leppie wrote:
Tip: DefaultIfEmpty()
Not available in Entity Framework. I have been doing some homework. :)
There, I fixed the subject. Do not curse my precious Linq2SQL :)
xacc.ide
IronScheme - 1.0 RC 1 - out now!
((λ (x) `(,x ',x)) '(λ (x) `(,x ',x))) The Scheme Programming Language – Fourth Edition -
There, I fixed the subject. Do not curse my precious Linq2SQL :)
xacc.ide
IronScheme - 1.0 RC 1 - out now!
((λ (x) `(,x ',x)) '(λ (x) `(,x ',x))) The Scheme Programming Language – Fourth EditionStill, Linq2SQL doesn't have an outer join operator. Full stop.
-
Still, Linq2SQL doesn't have an outer join operator. Full stop.
Brady Kelly wrote:
Still, Linq2SQL doesn't have an outer join operator. Full stop.
Yes, but I am sure with a little tweaking an OUTER JOIN can be emitted. To be honest, I dont even care about SQL syntax anymore, as long as LINQ spits out a minimum number of queries to get your data, then I am happy :) Sometimes to squeeze out the most, you will have to prepare some lookup queries ahead of time.
xacc.ide
IronScheme - 1.0 RC 1 - out now!
((λ (x) `(,x ',x)) '(λ (x) `(,x ',x))) The Scheme Programming Language – Fourth Edition -
Brady Kelly wrote:
Still, Linq2SQL doesn't have an outer join operator. Full stop.
Yes, but I am sure with a little tweaking an OUTER JOIN can be emitted. To be honest, I dont even care about SQL syntax anymore, as long as LINQ spits out a minimum number of queries to get your data, then I am happy :) Sometimes to squeeze out the most, you will have to prepare some lookup queries ahead of time.
xacc.ide
IronScheme - 1.0 RC 1 - out now!
((λ (x) `(,x ',x)) '(λ (x) `(,x ',x))) The Scheme Programming Language – Fourth EditionSeeing as this is a paying job, and I want to drink beer, I have opted for a SQL view to provide the left join. Pragmatism sub-queries FTW! :cool:
-
Seeing as this is a paying job, and I want to drink beer, I have opted for a SQL view to provide the left join. Pragmatism sub-queries FTW! :cool:
Brady Kelly wrote:
I have opted for a SQL view to provide the left join.
You are lucky. Our whole DB has to stay SQLCE compatible, no views, SP's or functions.
xacc.ide
IronScheme - 1.0 RC 1 - out now!
((λ (x) `(,x ',x)) '(λ (x) `(,x ',x))) The Scheme Programming Language – Fourth Edition -
Natively it only has one 'join' operator, the equijoin, or inner join. A left or right join requires a subquery, and I don't want (today) to contemplate a full outer join.
Having to contemplate joins might be considered another negative aspect.
Personally, I love the idea that Raymond spends his nights posting bad regexs to mailing lists under the pseudonym of Jane Smith. He'd be like a super hero, only more nerdy and less useful. [Trevel]
| FoldWithUs! | sighist | µLaunch - program launcher for server core and hyper-v server -
Brady Kelly wrote:
I have opted for a SQL view to provide the left join.
You are lucky. Our whole DB has to stay SQLCE compatible, no views, SP's or functions.
xacc.ide
IronScheme - 1.0 RC 1 - out now!
((λ (x) `(,x ',x)) '(λ (x) `(,x ',x))) The Scheme Programming Language – Fourth EditionTurns out I couldn't use a view, or only use an unnecessarily complex view, so I subquery the value lists for later aggregation.
-
Having to contemplate joins might be considered another negative aspect.
Personally, I love the idea that Raymond spends his nights posting bad regexs to mailing lists under the pseudonym of Jane Smith. He'd be like a super hero, only more nerdy and less useful. [Trevel]
| FoldWithUs! | sighist | µLaunch - program launcher for server core and hyper-v serverSo true.
-
Natively it only has one 'join' operator, the equijoin, or inner join. A left or right join requires a subquery, and I don't want (today) to contemplate a full outer join.