Yield Return with Null

前端 未结 6 1734
长发绾君心
长发绾君心 2020-12-16 09:52

Is there any way to optionally return a null with a \"return yield\" driven iterator?

I would like to return a null in some cases and I don\'t think this is particul

6条回答
  •  时光说笑
    2020-12-16 10:18

    There is nothing that prevents you from doing a yield return null;, if it is appropriate (of course, the enumerated type must be nullable).

提交回复
热议问题