public ActiveDirectoryUser(ADUserDirectory directory, UserId userId, string displayName, string emailAddress)
 {
     this.directory    = directory;
     this.userId       = userId ?? throw new ArgumentNullException(nameof(userId));
     this.DisplayName  = AH.CoalesceString(displayName, userId.Principal);
     this.EmailAddress = emailAddress;
 }
Exemplo n.º 2
0
            public ActiveDirectoryUser(UserId userId, string displayName, string emailAddress, ADUserDirectory directory)
            {
                this.UserName      = userId.Principal;
                this.Domain        = userId.DomainAlias;
                this.DisplayName   = AH.CoalesceString(displayName, this.UserName);
                this.EmailAddress  = emailAddress;
                this.principalName = $"{userId.Principal}@{userId.DomainAlias}";

                this.groupsLazy = new Lazy <HashSet <GroupId> >(() => {
                    var groups = new HashSet <GroupId>();
                    directory.GetParentGroups(userId, groups, true);
                    return(groups);
                });
                this.directory = directory;
            }