Ejemplo n.º 1
0
        public Account GetByLogin(string login)
        {
            var filter = _filterBuildingService.BuildFilterForGettingUserByLogin(login);
            var entity = _activeDirectoryService.Find(_parentDistinguishedName, filter);

            var user = Mapper.Map <Account>(entity);

            if (user == null)
            {
                return(null);
            }

            if (!string.IsNullOrEmpty(user.ManagerDistinguishedName))
            {
                user.Manager = GetByDistinguishedName(user.ManagerDistinguishedName);
            }

            return(user);
        }