Example #1
0
        public void Dispose()
        {
            if (Impersonation != null)
            {
                Impersonation.ImpersonationEnd();

                Impersonation = null;
            }
        }
Example #2
0
        public ImpersonationWrapper(bool isUsed, string domain, string creditId, string creditPwd)
        {
            // Impersonation을 사용할 경우만 값을 초기화 시켜준다.
            if (isUsed)
            {
                domain.ThrowIfNullOrWhiteSpace(nameof(domain));
                creditId.ThrowIfNullOrWhiteSpace(nameof(creditId));
                creditPwd.ThrowIfNullOrWhiteSpace(nameof(creditPwd));

                Impersonation = new Impersonation();

                Impersonation.ImpersonationStart(domain, creditId, creditPwd);
            }
        }