How to debug a LINQ Statement

后端 未结 9 1196
自闭症患者
自闭症患者 2020-12-04 23:47

I have a Linq to objects statement

 var confirm = from l in lines.Lines 
 where (l.LineNumber == startline.LineNumber) || (l.LineNumber == endline.LineNumber         


        
9条回答
  •  -上瘾入骨i
    2020-12-05 00:36

    From the looks of the error I would suggest you take a look at line.Lines and make sure its enumerator is implemented properly. I think it's returning a null when it shouldn't.

    Oh and just make sure the line and line.Lines objects aren't null or returning nulls as well.

提交回复
热议问题