How to get Resharper to convert back to a foreach loop

妖精的绣舞 提交于 2020-02-03 03:46:06

问题


Resharper 5 can convert my foreachloops to Linq queries. Which I like. But linq is way way way harder to debug than a foreachloop.

When I convert my foreach statement to a linq query, I don't see any option to go back the other way.

Does any one know how to do this? Is it even possible?


回答1:


We are working on LINQ2Foreach (and some other) functionality for ReSharper vNext




回答2:


I do not believe this is possible. Certainly, it's not listed in the examples of Quick Fixes, where loop-to-LINQ-expression is shown.

What you should be able to do is use the Context Action 'Convert LINQ to methods chain' to go from the 'fluent' style to the 'methods' style, and then selectively use 'Introduce variable' to pull the expression to pieces.



来源:https://stackoverflow.com/questions/3188055/how-to-get-resharper-to-convert-back-to-a-foreach-loop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!