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); } }
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); }
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); }
public SearchRequest(string distinguishedName, string ldapFilter, Native.Native.LdapSearchScope searchScope) { DistinguishedName = distinguishedName; Scope = searchScope; Filter = ldapFilter; }