?? operator and navigator fields in projection

Posts   
 
    
Deividas
User
Posts: 44
Joined: 01-Oct-2010
# Posted on: 04-Nov-2010 22:02:54   

I get an error with the message "The multi-part identifier "LPLA_2.Name" could not be bound." when using such query:

from t in metaData.Table1
select new { Result = t.StringColumn ?? t.Navigation.Name };

No inheritance here. StringColumn is nullable. Navigation was also nullable in my case, but one of the two fields was always filled.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 05-Nov-2010 05:34:00   
David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 05-Nov-2010 14:50:58   

Reproduced. It doesn't add the relationship in the field. disappointed

Sorry for all these linq issues, Deividas. After 2+ years we thought we had everything ironed out, there were hardly bugs mentioned in v3's linq provider anymore. Still we have some dark spots to cover it seems.

Looking into it.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 05-Nov-2010 15:13:44   

Fixed. 'Coalesce' was a special case, as VB.NET emits it sometimes where the left side is only needed. And as it's a special case (yeah, linq provider code is fun wink ) it didn't benefit from the code elsewhere, where we pull relations discovered in projections to the main query. It now does that. See attached linq provider.

Frans Bouma | Lead developer LLBLGen Pro
Deividas
User
Posts: 44
Joined: 01-Oct-2010
# Posted on: 05-Nov-2010 20:46:00   

Otis wrote:

Sorry for all these linq issues, Deividas. After 2+ years we thought we had everything ironed out, there were hardly bugs mentioned in v3's linq provider anymore. Still we have some dark spots to cover it seems.

I used LLBLGen several years before and have very good memories about it. So I recommended it to my current employer. And it was very odd to me that every time I tried to write a semi-complex linq query, it failed. It seemed that LLBLGen supports only a fraction of linq features. At first it didn't even occur to me that these were bugs, I just thought that LLBLGen didn't support the features. Part of the problem was that most of the linq examples in documentation are very simple (except maybe the "Contains" examples), almost no information about inheritance, nothing about joins. It was very frustrating.

So I'm very glad that I turned to the forums. Somehow I realised that the problems I was facing were bugs and I had a chance to experience the famous LLBLGen support, which is as good as I remember from years before, maybe even better. simple_smile And now I'm loving linq to LLBLGen. simple_smile

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 05-Nov-2010 21:11:43   

Deividas wrote:

Otis wrote:

Sorry for all these linq issues, Deividas. After 2+ years we thought we had everything ironed out, there were hardly bugs mentioned in v3's linq provider anymore. Still we have some dark spots to cover it seems.

I used LLBLGen several years before and have very good memories about it. So I recommended it to my current employer. And it was very odd to me that every time I tried to write a semi-complex linq query, it failed. It seemed that LLBLGen supports only a fraction of linq features. At first it didn't even occur to me that these were bugs, I just thought that LLBLGen didn't support the features. Part of the problem was that most of the linq examples in documentation are very simple (except maybe the "Contains" examples), almost no information about inheritance, nothing about joins. It was very frustrating.

LINQ2LLBL has been tested for a long time for many users. It happens that eventually someone comes with an edge un-tested case, like you. Anyway, this feedback is very helpful to make the product better. So thanks.

Deividas wrote:

So I'm very glad that I turned to the forums. Somehow I realised that the problems I was facing were bugs and I had a chance to experience the famous LLBLGen support, which is as good as I remember from years before, maybe even better. simple_smile And now I'm loving linq to LLBLGen. simple_smile

Thanks for the feedback simple_smile

David Elizondo | LLBLGen Support Team