Home > Net >  LINQ left join on empty table
LINQ left join on empty table

Time:01-13



As shown in figure, if left behind the join table is null on condition of field will be an error, ask the great spirit guide!

CodePudding user response:

Are you sure is empty table or planList this object is null

CodePudding user response:

reference 1st floor duanzi_peng response:
are you sure empty table or planList this object to null

PlanList this object to null

CodePudding user response:

refer to the second floor weixin_41831497 response:
Quote: refer to 1st floor duanzi_peng response:

Are you sure is empty table or planList this object to null

PlanList this object to null

Null will not be able to use, the use of judgment before,

CodePudding user response:

What do you think the way you outside this even a bit yes, generally not
The join T3 in planList on T1. ConID equals T3. ConID into temp
The from tt in temp. DefaultIfEmpty ()
Is that so?

CodePudding user response:


With this, almost to the empty data processing

CodePudding user response:

Associated data might be empty, the association of the table with three expressions, filtering, this is not an error

CodePudding user response:

So how to solve the empty collection
  •  Tags:  
  • LINQ
  • Related