src/Moq.Proxy/BehaviorPipeline.cs
/// <summary>
/// Execute the pipeline with the given input.
/// </summary>
/// <param name="input">Input to the method call.</param>
/// <param name="target">The ultimate target of the call.</param>
/// <returns>Return value from the pipeline.</returns>
Execute the pipeline with the given input.
Execute the pipeline with the given input .
public IMethodReturn Invoke(IMethodInvocation input, InvokeBehavior target)
		{
			if (Behaviors.Count == 0)
				return target(input, null);
			var index = 0;
			return Behaviors[0].Invoke(input, () =>
			{
				++index;
				return (index < Behaviors.Count) ?
					Behaviors[index].Invoke :
					target;
			});
		}
public IMethodReturn Invoke ( IMethodInvocation input , InvokeBehavior target ) { if ( Behaviors . Count == 0 ) return target ( input , null ) ; var index = 0 ; return Behaviors [ 0 ] . Invoke ( input , ( ) => { ++ index ; return ( index < Behaviors . Count ) ? Behaviors [ index ] . Invoke : target ; } ) ; }
Execute the pipeline with the given input.
Execute the pipeline with the given input .
Return value from the pipeline.
Return value from the pipeline .
input
IMethodInvocation
Input to the method call.
Input to the method call .
target
InvokeBehavior
The ultimate target of the call.
The ultimate target of the call .