示例#1
0
        // todo: constructors for value types
        protected override Delegate GetShimAction()
        {
            if (!ExpressionParameters.Any())
            {
                return((Func <T>)(() => LogAndReturn()));
            }

            return(GenerateDynamicShim());
        }
示例#2
0
        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());
        }