CCNet.SourceNotifier.Gateways.ActiveDirectoryGateway.GetUserInfo C# (CSharp) Method

GetUserInfo() public method

Retrieves the UserInfo by a specified userName, using the results caching.
public GetUserInfo ( string userName ) : IUserInfo
userName string
return IUserInfo
		public IUserInfo GetUserInfo(string userName)
		{
			return m_cache.Get(
				userName,
				() =>
				{
					using (var principalContext = new PrincipalContext(ContextType.Domain, GetDomain(userName)))
					{
						var result = UserPrincipal.FindByIdentity(principalContext, userName);
						if (result != null)
						{
							return UserInfoFactory.CreateUserInfo(result);
						}

						return UserInfoFactory.CreateUserInfo(userName);
					}
				});
		}
	}
ActiveDirectoryGateway