public CaseLDAPReturn Get(string queryBy, string searchTerm, bool getDetails = false)
        {
            switch (queryBy.ToLower())
            {
                case "caseid":
                    _retval =_ldap.Search(CaseLDAPSearchAttributes.UserID, searchTerm, getDetails);
                    break;
                case "lastname":
                    _retval = _ldap.Search(CaseLDAPSearchAttributes.LastName, searchTerm, getDetails);
                    break;
                case "wholename":
                    _retval = _ldap.Search(CaseLDAPSearchAttributes.WholeName, searchTerm, getDetails);
                    break;
                case "phone":
                    _retval = _ldap.Search(CaseLDAPSearchAttributes.Telephone, searchTerm, getDetails);
                    break;
                case "ldapquery":
                case "raw":
                    _retval = _ldap.Search(CaseLDAPSearchAttributes.Raw, searchTerm, getDetails);
                    break;
                case "adsgroup":
                    _retval = _ldap.Search(CaseLDAPSearchAttributes.ADSGroup, searchTerm, getDetails); //We are expecting an ads group name.
                    break;

            }          
            return _retval;
        }
 public PooController(CaseLDAPSearchContext ldap, CaseLDAPReturn retval)
 {
     _ldap = ldap;
     _retval = retval;
 }
 public CaseLDAPSearchContext(IOptions<LDAPOptions> options, CaseLDAPReturn retval, ActiveDirectory activeDirectory)
 {
     Options = options.Value;
     _retval = retval;
     ads = activeDirectory;
 }