Exemplo n.º 1
0
 public SearchRequest(string distinguishedName, string ldapFilter, Native.Native.LdapSearchScope searchScope, params string[] attributeList)
 {
     DistinguishedName = distinguishedName;
     Scope             = searchScope;
     Filter            = ldapFilter;
     if (attributeList != null)
     {
         Attributes.AddRange(attributeList);
     }
 }
Exemplo n.º 2
0
        public IList <LdapEntry> Search(string @base, string filter,
                                        Native.Native.LdapSearchScope scope = Native.Native.LdapSearchScope.LDAP_SCOPE_SUBTREE)
        {
            var response = (SearchResponse)SendRequest(new SearchRequest(@base, filter, scope));

            if (response.ResultCode != Native.Native.ResultCode.Success && !response.Entries.Any())
            {
                ThrowIfResponseError(response);
            }
            return(response.Entries);
        }
Exemplo n.º 3
0
        public async Task <IList <LdapEntry> > SearchAsync(string @base, string filter,
                                                           Native.Native.LdapSearchScope scope = Native.Native.LdapSearchScope.LDAP_SCOPE_SUBTREE,
                                                           CancellationToken token             = default)
        {
            var response = (SearchResponse) await SendRequestAsync(new SearchRequest(@base, filter, scope), token);

            if (response.ResultCode != Native.Native.ResultCode.Success && !response.Entries.Any())
            {
                ThrowIfResponseError(response);
            }
            return(response.Entries);
        }
Exemplo n.º 4
0
 public SearchRequest(string distinguishedName, string ldapFilter, Native.Native.LdapSearchScope searchScope)
 {
     DistinguishedName = distinguishedName;
     Scope             = searchScope;
     Filter            = ldapFilter;
 }