// todo: constructors for value types protected override Delegate GetShimAction() { if (!ExpressionParameters.Any()) { return((Func <T>)(() => LogAndReturn())); } return(GenerateDynamicShim()); }
protected override Delegate GetShimAction() { // if it's not necessary, don't build a dynamic method // this shortcut bypasses the ShimmedMethodLibrary // and the overhead of a dynamicmethod // while still logging the call if (!ExpressionParameters.Any() && Method.IsStatic) { return((Action)(() => AddCallResult())); } return(GenerateDynamicShim()); }