
请参阅下面的第2行,作为需要内联注释的示例
Dim Jobs = (From X In DB.Jobs_Select(SearchStr,RequiresFilter) Where X.JobStatusID < 2 -- **** INSERT INliNE COMMENT HERE **** Order By X.JobPriorityID Descending,If(X.TargetDate,Date.MaxValue),X.Needslit Descending,X.HasoldArtRequests Descending,X.HasoldlicRequests Descending )
这在sql代码中是微不足道的,坦率地说,当SP变得复杂时非常有用.能够在liNQ to sql中执行相同的跨开发人员通信会很高兴.
更新
这是您的测试条件.
Dim L As New List(Of keyvaluePair(Of Integer,Integer)) Dim a = (From X In L Where X.Key > 5 'test comment Order By X.Value)解决方法 好的伙计,这是官方的答案 – 在VB中不可能. Proof.
It is REALLY annoying in VB that you cannot add inline comments to
multiline liNQ statements!
更多信息:
总结The bad news is that this wouldn’t be trivial to implement.
limitations about single-lines and comments are built into the current
VB parser at too low a level. It’d require a complete rewrite of the
VB parser.The good news is that we’ve embarked upon such a rewrite (codenamed
“Roslyn” — there have been several articles and talks about it). It’s
still a way off and we’re not making commitments about what/when at
this stage.— Lucian Wischik,VB language PM
以上是内存溢出为你收集整理的VB.NET中的内联LINQ注释全部内容,希望文章能够帮你解决VB.NET中的内联LINQ注释所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)