Skip to content

Pact Impersonation IImpersonator

welshronaldo edited this page May 30, 2022 · 7 revisions

IImpersonator Interface

Interface onto execution of an action in an impersonated context (typically file-system)
Reason for this being here is so we could have separate libraries providing the actual implementation (e.g. for Windows and Linux etc.)

public interface IImpersonator

Derived
WindowsImpersonator

Methods
Execute<T>(ImpersonationSettings, Func<T>) Executes the provided action within the impersonated context
Execute(ImpersonationSettings, Action) Executes the provided action within the impersonated context
ExecuteAsync<T>(ImpersonationSettings, Func<Task<T>>) Executes the provided action within the impersonated context
ExecuteAsync(ImpersonationSettings, Func<Task>) Executes the provided action within the impersonated context
Clone this wiki locally