我收到以下 linq 查询的空引用异常:
Dim Report = From Filter In EDTKPDPDescVar _
Group Join EDTK In eDTKBase _
On Filter.eDTK_PDP_Code Equals EDTK.eDTK_PDP_Code _
Into g = Group _
From EDTK In g.DefaultIfEmpty _
Group Join PLI In ProdBase _
On EDTK.eDTK_PLI Equals PLI.Siebel_PLI _
Into h = Group _
From PLI In h.DefaultIfEmpty _
Select eDTK_PDP_Code = Filter.eDTK_PDP_Code, _
eDTK_PLI = EDTK.eDTK_PLI, _
System = "eDTK Instance: " + EDTK.eDTK_Instance, _
PDD_PDP_Description = EDTK.PDD_PDP_Description, _
Siebel_PDP_Description = PLI.Siebel_PDP_Description, _
eDTK_PDP_Description = EDTK.eDTK_PDP_Description
创建错误的字段(数据类型是字符串)是这个:
Siebel_PDP_Description = PLI.Siebel_PDP_Description
在没有 if/then 语句测试 null 并分配值的情况下,如何防止出现此错误?