Method ExecuteMethodAsync<T>
Namespace: Belay.Core
Assembly: Belay.Core.dll
ExecuteMethodAsync<T>(MethodInfo, object?, object?[]?, CancellationToken)
Executes a method with automatic executor selection based on attributes. This is the main entry point for the attribute-based programming model and uses secure execution context.
public Task<T> ExecuteMethodAsync<T>(MethodInfo method, object? instance = null, object?[]? parameters = null, CancellationToken cancellationToken = default)
Parameters
method
MethodInfo
The method to execute.
instance
object?
The instance to invoke the method on (null for static methods).
parameters
object?[]?
The parameters to pass to the method.
cancellationToken
CancellationToken
Cancellation token to cancel the execution.
Returns
Task<T>
The result of the method execution.
Type Parameters
T
The expected return type.
ExecuteMethodAsync(MethodInfo, object?, object?[]?, CancellationToken)
Executes a method without returning a value with automatic executor selection based on attributes.
public Task ExecuteMethodAsync(MethodInfo method, object? instance = null, object?[]? parameters = null, CancellationToken cancellationToken = default)
Parameters
method
MethodInfo
The method to execute.
instance
object?
The instance to invoke the method on (null for static methods).
parameters
object?[]?
The parameters to pass to the method.
cancellationToken
CancellationToken
Cancellation token to cancel the execution.
Returns
A task representing the asynchronous operation.