我想这样做:
class Foo {
static Func<string> sRunner;
Func<string> _runner;
public Foo(Func<string> runner){
_runner = runner ?? sRunner ?? () => "Hey!";
}
}
我在lambda上得到一个“无效表达式”术语。可以内联修复吗?
答案 0 :(得分:12)
_runner = runner ?? sRunner ?? (() => "Hey!");