How to yield return inside anonymous methods?

后端 未结 7 481
南笙
南笙 2021-01-07 16:43

Basically I have an anonymous method that I use for my BackgroundWorker:

worker.DoWork += ( sender, e ) =>
{
    foreach ( var effect in Glob         


        
7条回答
  •  离开以前
    2021-01-07 17:13

    Perhaps just return the linq expression and defer execution like yield:

    return GlobalGraph.Effects.Select(x => image.Apply(x));
    

提交回复
热议问题