How to yield return inside anonymous methods?

后端 未结 7 478
南笙
南笙 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));
    
    0 讨论(0)
提交回复
热议问题