private void ExecuteCommand(Expression<Func<bool>> command)
{
bool success = command.Compile().Invoke();
}
private void Test()
{
ExecuteCommand(() => _gc.ChargeCancellation(""));
}
이 코드를 사용하면 NullReferenceException이 발생합니다.일반 람다 식을 호출하는 방법은 무엇입니까?
어디서 NullReferenceExecption을 얻었습니까? _gc 란 무엇입니까? – tster
게시하지 않은 코드에서'_gc'이 초기화 되었습니까? – unholysampler
_gc가 null이 아닙니다. – Rookian