private void ExecuteCommand(Expression<Func<bool>> command)
{
bool success = command.Compile().Invoke();
}
private void Test()
{
ExecuteCommand(() => _gc.ChargeCancellation(""));
}
有了這段代碼,我得到了一個NullReferenceException。如何調用泛型lambda表達式?
你從哪裏得到一個NullReferenceExecption?什麼是_gc? – tster 2010-07-30 15:07:06
'_gc'是否在你沒有發佈的代碼中被初始化? – unholysampler 2010-07-30 15:07:53
_gc不爲空。 – Rookian 2010-07-30 15:38:30