AddBehavior(TStunt, ExecuteHandler, AppliesToHandler?, String?) Method

Definition

Namespace Stunts
Assembly Stunts.dll

Adds a behavior to a stunt.

public static TStunt AddBehavior<TStunt>(this TStunt stunt, ExecuteHandler behavior, AppliesToHandler? appliesTo = null, string? name = null)
    where TStunt : IStunt

Type parameters

TStunt

Parameters

stunt
{TStunt}

The stunt to add the behavior to.

behavior
ExecuteHandler

(invocation, next) => invocation.CreateValueReturn() | invocation.CreateExceptionReturn() | next().Invoke(invocation, next)

appliesTo
AppliesToHandler

invocation => true|false

name
String

Optional friendly name for the behavior.

Returns

{TStunt}