Skip to content

Pact Impersonation IImpersonator ExecuteAsync T (Pact Impersonation ImpersonationSettings System Func System Threading Tasks Task T )

welshronaldo edited this page May 30, 2022 · 5 revisions

IImpersonator.ExecuteAsync<T>(ImpersonationSettings, Func<Task<T>>) Method

Executes the provided action within the impersonated context

System.Threading.Tasks.Task<T> ExecuteAsync<T>(Pact.Impersonation.ImpersonationSettings settings, System.Func<System.Threading.Tasks.Task<T>> func);

Type parameters

T

Parameters

settings Pact.Impersonation.ImpersonationSettings
Passed on a per-action basis as it's not improbable you may need to impersonate with different credentials

func System.Func<System.Threading.Tasks.Task<T>>
The function to execute

Returns

System.Threading.Tasks.Task<T>

Clone this wiki locally