PostSharp 2023.0 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Aspects Namespace / Location­Interception­Args Class / Location­Interception­Args Methods / Location­Interception­Args.​Execute(TPayload) Method

LocationInterceptionArgs.Execute<TPayload> Method

Executes a delegate for the current LocationInterceptionArgs. This method allows to execute strongly-typed operations and avoid boxing required by the weakly typed ILocationInterceptionArgs interface.

Namespace:  PostSharp.Aspects
Assembly:  PostSharp (in PostSharp.dll) Version: 2023.0.3.0 (2023.0.3.0)
public abstract void Execute<TPayload>(
	ILocationInterceptionArgsAction<TPayload> action,
	ref TPayload payload


Type: PostSharp.Aspects.ILocationInterceptionArgsAction<TPayload>
Class (typically a singleton) that contains the generic method Execute<TValue>(ILocationInterceptionArgs<TValue>, TPayload) that will be executed with the right method generic argument.
Type: TPayload
An argument being passed to the Execute<TValue>(ILocationInterceptionArgs<TValue>, TPayload) method of the action parameter.

Type Parameters

Type of the payload.


ILocationInterceptionArgs.Execute<TPayload>(ILocationInterceptionArgsAction<TPayload>, TPayload)
Note Note

This method is ignored by the advice optimizer. As a result, the optimizer will not know that the action implementation uses any feature of the LocationInterceptionArgs object, and the code supporting these features won't be generated. If these features are required by action, they must be referenced inside the OnGetValue(LocationInterceptionArgs) or OnSetValue(LocationInterceptionArgs) method.

See Also