当前位置: 代码迷 >> C# >> 泛型的where中lambda表达式如何调出当前循环
  详细解决方案

泛型的where中lambda表达式如何调出当前循环

热度:197   发布时间:2016-05-05 05:21:07.0
泛型的where中lambda表达式怎么调出当前循环?
比如:

                _model.Detail.ForEach(item =>
                    {
                        if (item.ReturnStatus != "Y")
                        { isConfirmALL = false; return; }
                        isConfirmALL = true;
                    });

这个return只能结束此次循环而进入下次循环,就相当于for中的continue一样,我现在要break的效果,应该用哪个词?
------解决思路----------------------
https://social.msdn.microsoft.com/Forums/zh-CN/a44cd06b-a9c2-4852-9a04-a6347735d930/break-in-list?forum=vsdebug
------解决思路----------------------
换成,Parallel.For
https://social.msdn.microsoft.com/Forums/vstudio/zh-CN/0e2a5cb9-d25e-4521-a3ba-20a020010a0a/loop-break?forum=parallelextensions
  相关解决方案