Deferred execution in C#

前端 未结 6 2027
无人共我
无人共我 2021-01-04 07:36

How could I implement my own deferred execution mechanism in C#?

So for instance I have:

string x = DoFoo();

Is it possible to perf

6条回答
  •  时光说笑
    2021-01-04 07:44

    Instead of passing a string x, pass a delegate that procures you a string

    Func fooFunc=()=>DoFoo();
    

提交回复
热议问题