说我有以下课程
public class Conditional
{
private readonly Func<Boolean> _conditional;
public Conditional(Func<Boolean> test)
{
_conditional = test;
}
public override BehaviourReturnCode Behave()
{
var conditionalResult = _conditional.Invoke();
//... keeps going
}
所以当我创建一个条件实例时,我会做类似的事情
var isAlive = new Conditional(actor.IsAlive);
所以问题是,我怎样才能找到_conditional的方法名称,在这种情况下是 IsAlive ?
仅供参考 _conditional.Method.Name 不这样做:D
干杯