예제 #1
0
 /// <summary>
 /// Since no <see cref="ExecuteHandler"/> is provided as a target, and a value is required to
 /// return, this defaults to throwing a <see cref="NotImplementedException"/> if no
 /// behavior returns before reaching the target.
 /// </summary>
 public static T?Execute <T>(this BehaviorPipeline pipeline, IMethodInvocation invocation)
 => (T?)pipeline.Invoke(invocation, true).ReturnValue;
예제 #2
0
 /// <summary>
 /// Executes the pipeline and returns a <see cref="Ref{T}"/> to it. If the returned
 /// value from the pipeline execution is already a <see cref="Ref{Type}"/>, it's
 /// returned as-is, otherwise, the <typeparamref name="T"/> value is wrapped in a new
 /// <see cref="Ref{T}"/>.
 /// </summary>
 public static Ref <T> ExecuteRef <T>(this BehaviorPipeline pipeline, IMethodInvocation invocation)
 => pipeline.Invoke(invocation, true).AsRef <T>();
예제 #3
0
 public static IMethodReturn Execute(this BehaviorPipeline pipeline, IMethodInvocation invocation)
 => pipeline.Invoke(invocation, true);