How to debug a LINQ Statement

后端 未结 9 1242
自闭症患者
自闭症患者 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条回答
  •  清歌不尽
    2020-12-05 00:20

    [Disclaimer: I work at OzCode]

    The problem with LINQ is that it's hard to impossible to debug - even when dealing simple queries a developer is forced to refactor his/her query to a bunch of foreach loops, or use logging. LINQ debugging is supported in a soon-to-be-released version of OzCode (currently available as an Early Access Preview) and it helps developers drill into their LINQ code as well and pinpoint those hard to catch exceptions inside queries

    This is what your query would look like in OzCode:

提交回复
热议问题