How I get only one User of a List
<p>I have a question and I don't find the solution for it :(</p>

<p>I have a ASP.NEt Application that get Data from a Active Directory. I build a 3-tier Application. I have a Model Project that have a User Class ("Benutzer.cs") and a Data layer and Service Layer. 
In my Data layer I get the Informations about a user in AD. I want now get only one User and my question is how i can filter one User of a List. Maybe a stupid question but I don't know what I must do :D </p>

<p>My Code:</p>

<pre><code>...

                    IUserService srv = new UserService();
                    List&lt;Model.Benutzer&gt; usr = srv.GetUser(Domain, null, null, UserID); 

                        // I want the one User of this List can I found this User about
                        //  Benutzer User = usr.? 

                    ...
</code></pre>

<p>I want only one User. This is the Code of my getUser method:</p>

<pre><code>public List&lt;Benutzer&gt; GetUser(string Domain, string Benutzer, string Werk, string GUID)
        {
            List&lt;Benutzer&gt; result = new List&lt;Benutzer&gt;();

                DirectoryEntry Entry = new DirectoryEntry("LDAP://&lt;GUID=" + GUID + "&gt;");

                string filter = "(&amp;(objectClass=user)(objectCategory=person)(cn=*))"; 

                DirectorySearcher Searcher = new DirectorySearcher(Entry, filter);

                   SearchResult res = Searcher.FindOne();

                    result.Add(new Benutzer()
                    {
                        Benutzername = GetProperty(res, "sAMAccountName"),
                        Vorname = GetProperty(res, "givenName"),
                        Nachname = GetProperty(res, "sn"),
                        eMail = GetProperty(res, "mail"),
                        Unternehmen = GetProperty(res, "company"),
                        Abteilung = GetProperty(res, "Department"),
                        Raum = GetProperty(res, "physicalDeliveryOfficeName"),
                        Beschreibung = GetProperty(res, "Description"),
                        Kostenstelle = GetProperty(res, "extensionAttribute3"),
                        Telefonnummer = GetProperty(res, "telephoneNumber"),
                        Mobilnummer = GetProperty(res, "mobile"),
                        Haustelefon = GetProperty(res, "homePhone"),
                        Fax = GetProperty(res, "facsimileTelephoneNumber"),
                        Pager = GetProperty(res, "pager"),
                        Standort = GetProperty(res, "l")
                    });

            return result; 
        }
</code></pre>

<p>tarasov</p>
