<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>LINQtoAD Work Item Rss Feed</title><link>http://www.codeplex.com/LINQtoAD/WorkItem/List.aspx</link><description>LINQtoAD Work Item Rss Description</description><item><title>Commented Issue: Trying to get all users in a group is limited to 1500 records [6172]</title><link>http://linqtoad.codeplex.com/workitem/6172</link><description>When I do a query to get all users in a group like the one below &amp;#40;where &amp;#34;MyGroups&amp;#34; is AD Groups&amp;#41;&amp;#58;&lt;br /&gt;                var res &amp;#61; from i in ctx.MyGroups&lt;br /&gt;                          where i.Name &amp;#61;&amp;#61; GroupName&lt;br /&gt;                          select i.Members&amp;#59;&lt;br /&gt;The results are limited to 1500 records.  I believe there is some way to get around this limitation of the Directory Searcher using the &amp;#34;range&amp;#34;&amp;#58; &lt;br /&gt;&lt;br /&gt;DirectorySearcher groupMember &amp;#61; new DirectorySearcher&lt;br /&gt;    &amp;#40;group,&amp;#34;&amp;#40;objectClass&amp;#61;&amp;#42;&amp;#41;&amp;#34;,new string&amp;#91;&amp;#93;&amp;#123;&amp;#34;member&amp;#59;Range&amp;#61;0-500&amp;#34;&amp;#125;,SearchScope.Base&amp;#41;&amp;#59;&lt;br /&gt; &amp;#40;http&amp;#58;&amp;#47;&amp;#47;bcheul.tistory.com&amp;#47;archive&amp;#47;200811&amp;#41;&lt;br /&gt;&lt;br /&gt;It would be nice if your LINQ provider knew when it had hit 1500, then did another query for the next 1500 and so on until it had all users, then merged the results into the one list.  At the moment I am going to have to try and do this manually.&lt;br /&gt;Comments: ** Comment from web user: jay_burling ** &lt;p&gt;This has to do with the paging of results returned from AD. If you wrap the FindAll&amp;#40;&amp;#41; call in DirectoryQuery&amp;#60;T&amp;#62;.GetResults&amp;#40;&amp;#41; with a using and set a page size, it will continue until it retrieves all the results. Something like&amp;#58;&lt;/p&gt;&lt;p&gt;using &amp;#40; var s &amp;#61; new DirectorySearcher&amp;#40; root, q, properties.ToArray&amp;#40;&amp;#41;, _source.Scope &amp;#41; &amp;#41;&lt;br /&gt;&amp;#123;&lt;br /&gt;           s.PageSize &amp;#61; 1000&amp;#59;&lt;br /&gt;           ...&lt;br /&gt;           foreach &amp;#40;SearchResult sr in s.FindAll&amp;#40;&amp;#41;&amp;#41;&lt;br /&gt;           ...&lt;br /&gt;&amp;#125;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description><author>jay_burling</author><pubDate>Mon, 30 Apr 2012 14:41:38 GMT</pubDate><guid isPermaLink="false">Commented Issue: Trying to get all users in a group is limited to 1500 records [6172] 20120430024138P</guid></item><item><title>Commented Issue: Really Big Problem:  Doesn't Filter Distinguished Name properly.  Doesn't Handle Escape Characters Correctly Upon WHERE Comparison [3693]</title><link>http://linqtoad.codeplex.com/workitem/3693</link><description>Tell me I am not the only one to run into this...&lt;br /&gt;&lt;br /&gt;The Distinguished Name of an object in the Active Directoy requires that certain characters are escaped.  Please refer to http&amp;#58;&amp;#47;&amp;#47;www.rlmueller.net&amp;#47;CharactersEscaped.htm.&lt;br /&gt;&lt;br /&gt;I have an Active Directory group named &amp;#34;MyActiveDirectoryGroupName&amp;#34; which contains objects that have the following Distinguished Name&amp;#39;s&amp;#58;&lt;br /&gt;&lt;br /&gt;&amp;#34;CN&amp;#61;John Doe,OU&amp;#61;Location A,OU&amp;#61;Company Objects,DC&amp;#61;mycompany,DC&amp;#61;com&amp;#34;&lt;br /&gt;&amp;#34;CN&amp;#61;Jane Doe,OU&amp;#61;Location A,OU&amp;#61;Company Objects,DC&amp;#61;mycompany,DC&amp;#61;com&amp;#34;&lt;br /&gt;&amp;#34;CN&amp;#61;Krugar, Freddy,OU&amp;#61;Location A,OU&amp;#61;Company Objects,DC&amp;#61;mycompany,DC&amp;#61;com&amp;#34;&lt;br /&gt;&lt;br /&gt;Notice the , in the &amp;#34;CN&amp;#61;&amp;#34;.  As far as Active Directory is concerned this translates to&amp;#58;&lt;br /&gt;&amp;#34;CN&amp;#61;Krugar&amp;#92;, Freddy,OU&amp;#61;Location A,OU&amp;#61;Company Objects,DC&amp;#61;mycompany,DC&amp;#61;com&amp;#34; because the  , has to be escaped using a &amp;#92; in front of it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;But guess what...when I run the following query&amp;#58;&lt;br /&gt;&lt;br /&gt;------------------------------------&lt;br /&gt;        DirectoryEntry ROOT &amp;#61; new DirectoryEntry&amp;#40;ConfigurationSettings.AppSettings&amp;#91;&amp;#34;ActiveDirectory&amp;#34;&amp;#93;&amp;#41;&amp;#59;&lt;br /&gt;        MyCompanyName.LINQ.ActiveDirectory.ADsContext ctx &amp;#61; new MyCompanyName.LINQ.ActiveDirectory.ADsContext&amp;#40;ROOT&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;        var results &amp;#61; from item in ctx.Groups&lt;br /&gt;                      where item.Name &amp;#61;&amp;#61; &amp;#34;MyActiveDirectoryGroupName&amp;#34;         &amp;#47;&amp;#47; Note&amp;#58; Name is the &amp;#91;DirectoryAttribute&amp;#40;&amp;#34;name&amp;#34;&amp;#41;&amp;#93; for the Group object.&lt;br /&gt;                      select item&amp;#59;&lt;br /&gt;&lt;br /&gt;        foreach &amp;#40;var item in results&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            rptrGroupMember.DataSource &amp;#61; item.Members&amp;#59;&lt;br /&gt;            rptrGroupMember.DataBind&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;        &amp;#125;&lt;br /&gt;---------------------------------&lt;br /&gt;Above Members is a string&amp;#91;&amp;#93; array of the Distinguished Name&amp;#39;s of the members in the group I just query&amp;#39;d. LOL&amp;#33;  Yay this is what I want....oh but wait...&lt;br /&gt;&lt;br /&gt;Now I need to take the value in the Members&amp;#91;x&amp;#93; &amp;#40;which is the string Distinguished Name&amp;#41; and go lookup the User information since the Distinguished Name is the unique value I should be using to lookup a user fromt he Active Directory right, or any other object for that matter&amp;#63; ....ok lets do that...&lt;br /&gt;&lt;br /&gt;So I created the following additional query&amp;#58;&lt;br /&gt;&lt;br /&gt;------------------------------------&lt;br /&gt;public string GetGroupMemberSAMAccountName&amp;#40;object data&amp;#41;&lt;br /&gt;&amp;#123;&lt;br /&gt;        DirectoryEntry ROOT &amp;#61; new DirectoryEntry&amp;#40;ConfigurationSettings.AppSettings&amp;#91;&amp;#34;ActiveDirectory&amp;#34;&amp;#93;&amp;#41;&amp;#59;&lt;br /&gt;        MyCompanyName.LINQ.ActiveDirectory.ADsContext ctx &amp;#61; new MyCompanyName.LINQ.ActiveDirectory.ADsContext&amp;#40;ROOT&amp;#41;&amp;#59;&lt;br /&gt;        &lt;br /&gt;        var results &amp;#61; from item in ctx.Users&lt;br /&gt;                      where item.Dn &amp;#61;&amp;#61; Convert.ToString&amp;#40;data&amp;#41;           &amp;#47;&amp;#47; Note&amp;#58; Dn is the &amp;#91;DirectoryAttribute&amp;#40;&amp;#34;distinguishedName&amp;#34;&amp;#41;&amp;#93; for the User object.&lt;br /&gt;                      select item&amp;#59;&lt;br /&gt;&lt;br /&gt;        string itemValue&amp;#61; string.Empty&amp;#59;&lt;br /&gt;&lt;br /&gt;        foreach &amp;#40;var item in results&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            itemValue&amp;#61; item.SAMAccountName&amp;#59;&lt;br /&gt;        &amp;#125;&lt;br /&gt;&lt;br /&gt;        return itemValue&amp;#59;&lt;br /&gt;&amp;#125;&lt;br /&gt;--------------------------------&lt;br /&gt;Ya this should work&amp;#33;  And guess what it does except for one thing which is a deal breaker.  The only result&amp;#40;s&amp;#41; I get back is the John Doe and the Jane Doe.  What&amp;#63;  Why&amp;#63;  Well after spending a lot of time trying to pin point it, a pattern started to emerge...crap...the Distinguished Name&amp;#39;s that have Last Name first and First Name last doesn&amp;#39;t match correctly when the LINQ builds the query to use against the LDAP search for the Active Directory.  I thought, well maybe I am passing the value wrong to it.  If you look at the Convert.ToString&amp;#40;data&amp;#41; value during debugging you see the following&amp;#58;&lt;br /&gt;&lt;br /&gt;&amp;#34;CN&amp;#61;Krugar&amp;#92;&amp;#92;, Freddy,OU&amp;#61;Location A,OU&amp;#61;Company Objects,DC&amp;#61;mycompany,DC&amp;#61;com&amp;#34;&lt;br /&gt;&lt;br /&gt;Hmmm...wonder what I have to do in order to get this LINQtoAD component to realize that this should match.  When I looked further into the debuggin I noticed that the &amp;#92; gets translated later on int he LINQtoAD project as the 0x5c value which of course is the ANSII value for &amp;#92;.  Don&amp;#39;t know if that has anything to do with it.  Anyone have any ideas or resolutions&amp;#63;  I can&amp;#39;t seriously be the only one who has run into this.  And this is the only LINQtoAD component out there that I am aware of.  Couldn&amp;#39;t we make it work a little better by having the component realize that matching on Distinguished Name is crutial since Active Directory uses this as the object fully qualified name&amp;#63;  It kinda like I want to search on a unique ID of a object but LINQtoAD won&amp;#39;t let me.  Bummer...  Any ideas&amp;#63;&lt;br /&gt;Comments: ** Comment from web user: mingsai ** &lt;p&gt;I believe the search operations work bi-directionally and this may be why you are seeing inconsistent results. See the following for additional information. http&amp;#58;&amp;#47;&amp;#47;www.ldapexplorer.com&amp;#47;en&amp;#47;manual&amp;#47;109010000-ldap-filter-syntax.htm&lt;/p&gt;</description><author>mingsai</author><pubDate>Thu, 23 Dec 2010 18:21:42 GMT</pubDate><guid isPermaLink="false">Commented Issue: Really Big Problem:  Doesn't Filter Distinguished Name properly.  Doesn't Handle Escape Characters Correctly Upon WHERE Comparison [3693] 20101223062142P</guid></item><item><title>Commented Issue: Trying to get all users in a group is limited to 1500 records [6172]</title><link>http://linqtoad.codeplex.com/workitem/6172</link><description>When I do a query to get all users in a group like the one below &amp;#40;where &amp;#34;MyGroups&amp;#34; is AD Groups&amp;#41;&amp;#58;&lt;br /&gt;                var res &amp;#61; from i in ctx.MyGroups&lt;br /&gt;                          where i.Name &amp;#61;&amp;#61; GroupName&lt;br /&gt;                          select i.Members&amp;#59;&lt;br /&gt;The results are limited to 1500 records.  I believe there is some way to get around this limitation of the Directory Searcher using the &amp;#34;range&amp;#34;&amp;#58; &lt;br /&gt;&lt;br /&gt;DirectorySearcher groupMember &amp;#61; new DirectorySearcher&lt;br /&gt;    &amp;#40;group,&amp;#34;&amp;#40;objectClass&amp;#61;&amp;#42;&amp;#41;&amp;#34;,new string&amp;#91;&amp;#93;&amp;#123;&amp;#34;member&amp;#59;Range&amp;#61;0-500&amp;#34;&amp;#125;,SearchScope.Base&amp;#41;&amp;#59;&lt;br /&gt; &amp;#40;http&amp;#58;&amp;#47;&amp;#47;bcheul.tistory.com&amp;#47;archive&amp;#47;200811&amp;#41;&lt;br /&gt;&lt;br /&gt;It would be nice if your LINQ provider knew when it had hit 1500, then did another query for the next 1500 and so on until it had all users, then merged the results into the one list.  At the moment I am going to have to try and do this manually.&lt;br /&gt;Comments: ** Comment from web user: adeelsansari ** &lt;p&gt;I am also having this issue, has anyone able to get around it&amp;#63;&lt;/p&gt;</description><author>adeelsansari</author><pubDate>Sat, 09 Oct 2010 05:18:17 GMT</pubDate><guid isPermaLink="false">Commented Issue: Trying to get all users in a group is limited to 1500 records [6172] 20101009051817A</guid></item><item><title>Commented Issue: Queries fail when using special characters [6421]</title><link>http://linqtoad.codeplex.com/workitem/6421</link><description>I had to search for displayName&amp;#39;s which started with a &amp;#34;&amp;#40;&amp;#34;. LDAP query syntax uses parenthesis and therefore can&amp;#39;t handle this without replacing that and other special characters with the escape sequence substitutes &amp;#40;http&amp;#58;&amp;#47;&amp;#47;msdn.microsoft.com&amp;#47;en-us&amp;#47;library&amp;#47;aa746475&amp;#37;28VS.85&amp;#37;29.aspx&amp;#41;&lt;br /&gt;&lt;br /&gt;I added the following function to my copy of DirectorySource.cs&lt;br /&gt;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;summary&amp;#62;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; Replaces the special characters.&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;&amp;#47;summary&amp;#62;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;param name&amp;#61;&amp;#34;constantValue&amp;#34;&amp;#62;The constant value.&amp;#60;&amp;#47;param&amp;#62;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;returns&amp;#62;&amp;#60;&amp;#47;returns&amp;#62;&lt;br /&gt;        private object ReplaceSpecialCharacters&amp;#40;object constantValue&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            if &amp;#40;constantValue is string&amp;#41;&lt;br /&gt;            &amp;#123;&lt;br /&gt;                StringBuilder returnValue &amp;#61; new StringBuilder&amp;#40;&amp;#40;string&amp;#41;constantValue&amp;#41;&amp;#59;&lt;br /&gt;                returnValue &amp;#61; returnValue.Replace&amp;#40;&amp;#64;&amp;#34;&amp;#92;&amp;#34;, &amp;#64;&amp;#34;&amp;#92;5c&amp;#34;&amp;#41;&amp;#59;&lt;br /&gt;                returnValue &amp;#61; returnValue.Replace&amp;#40;&amp;#64;&amp;#34;&amp;#42;&amp;#34;, &amp;#64;&amp;#34;&amp;#92;2a&amp;#34;&amp;#41;&amp;#59;&lt;br /&gt;                returnValue &amp;#61; returnValue.Replace&amp;#40;&amp;#64;&amp;#34;&amp;#40;&amp;#34;, &amp;#64;&amp;#34;&amp;#92;28&amp;#34;&amp;#41;&amp;#59;&lt;br /&gt;                returnValue &amp;#61; returnValue.Replace&amp;#40;&amp;#64;&amp;#34;&amp;#41;&amp;#34;, &amp;#64;&amp;#34;&amp;#92;29&amp;#34;&amp;#41;&amp;#59;&lt;br /&gt;                returnValue &amp;#61; returnValue.Replace&amp;#40;&amp;#64;&amp;#34;&amp;#47;&amp;#34;, &amp;#64;&amp;#34;&amp;#92;00&amp;#34;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;                return returnValue.ToString&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            &amp;#125;&lt;br /&gt;            return constantValue&amp;#59;&lt;br /&gt;        &amp;#125;&lt;br /&gt;&lt;br /&gt;And then modified ParsePredicate to contain the following&amp;#58;&lt;br /&gt;&lt;br /&gt;                    switch &amp;#40;m.Method.Name&amp;#41;&lt;br /&gt;                    &amp;#123;&lt;br /&gt;                        case &amp;#34;Contains&amp;#34;&amp;#58;&lt;br /&gt;                            &amp;#123;&lt;br /&gt;                                ConstantExpression c &amp;#61; m.Arguments&amp;#91;0&amp;#93; as ConstantExpression&amp;#59;&lt;br /&gt;                                sb.AppendFormat&amp;#40;&amp;#34;&amp;#123;0&amp;#125;&amp;#61;&amp;#42;&amp;#123;1&amp;#125;&amp;#42;&amp;#34;, GetFieldName&amp;#40;o.Member&amp;#41;, ReplaceSpecialCharacters&amp;#40;c.Value&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                                break&amp;#59;&lt;br /&gt;                            &amp;#125;&lt;br /&gt;                        case &amp;#34;StartsWith&amp;#34;&amp;#58;&lt;br /&gt;                            &amp;#123;&lt;br /&gt;                                ConstantExpression c &amp;#61; m.Arguments&amp;#91;0&amp;#93; as ConstantExpression&amp;#59;&lt;br /&gt;                                sb.AppendFormat&amp;#40;&amp;#34;&amp;#123;0&amp;#125;&amp;#61;&amp;#123;1&amp;#125;&amp;#42;&amp;#34;, GetFieldName&amp;#40;o.Member&amp;#41;, ReplaceSpecialCharacters&amp;#40;c.Value&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                                break&amp;#59;&lt;br /&gt;                            &amp;#125;&lt;br /&gt;                        case &amp;#34;EndsWith&amp;#34;&amp;#58;&lt;br /&gt;                            &amp;#123;&lt;br /&gt;                                ConstantExpression c &amp;#61; m.Arguments&amp;#91;0&amp;#93; as ConstantExpression&amp;#59;&lt;br /&gt;                                sb.AppendFormat&amp;#40;&amp;#34;&amp;#123;0&amp;#125;&amp;#61;&amp;#42;&amp;#123;1&amp;#125;&amp;#34;, GetFieldName&amp;#40;o.Member&amp;#41;, ReplaceSpecialCharacters&amp;#40;c.Value&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                                break&amp;#59;&lt;br /&gt;                            &amp;#125;&lt;br /&gt;                        default&amp;#58;&lt;br /&gt;                            throw new NotSupportedException&amp;#40;&amp;#34;Unsupported string filtering query expression detected. Cannot translate to LDAP equivalent.&amp;#34;&amp;#41;&amp;#59;&lt;br /&gt;                    &amp;#125;&lt;br /&gt;Comments: ** Comment from web user: bdesmet ** &lt;p&gt;This will be fixed in the upcoming release.&lt;/p&gt;</description><author>bdesmet</author><pubDate>Sun, 18 Jul 2010 04:00:33 GMT</pubDate><guid isPermaLink="false">Commented Issue: Queries fail when using special characters [6421] 20100718040033A</guid></item><item><title>Commented Issue: Memory Leak in DirectoryQuery.GetResults() [7443]</title><link>http://linqtoad.codeplex.com/workitem/7443</link><description>The following line causes a memory leak&amp;#58;&lt;br /&gt;&amp;#34;foreach &amp;#40;SearchResult sr in s.FindAll&amp;#40;&amp;#41;&amp;#41;&amp;#34;&lt;br /&gt;&lt;br /&gt;The reason for this can be found here&amp;#58;&lt;br /&gt;http&amp;#58;&amp;#47;&amp;#47;msdn.microsoft.com&amp;#47;en-us&amp;#47;library&amp;#47;system.directoryservices.directorysearcher.findall.aspx&lt;br /&gt;&lt;br /&gt;Ultimately, any time you use a SearchResultCollection object &amp;#40;such as when you call DirectorySearcher.FindAll&amp;#41;, you must dispose the SearchResultCollection object yourself. A fix would be to put the s.FindAll&amp;#40;&amp;#41; result into a variable managed by a USING block.&lt;br /&gt;Comments: ** Comment from web user: bdesmet ** &lt;p&gt;Will be addressed in an upcoming release.&lt;/p&gt;</description><author>bdesmet</author><pubDate>Fri, 16 Jul 2010 07:06:25 GMT</pubDate><guid isPermaLink="false">Commented Issue: Memory Leak in DirectoryQuery.GetResults() [7443] 20100716070625A</guid></item><item><title>Closed Issue: Error when using parameters inside where clause [2197]</title><link>http://linqtoad.codeplex.com/workitem/2197</link><description>I was playing around with your demo project and substituted static string text by a variable, so for example&amp;#58;&lt;br /&gt;&lt;br /&gt;           string test &amp;#61; &amp;#34;A&amp;#34;&amp;#59;&lt;br /&gt;            var res6 &amp;#61; from grp in groups&lt;br /&gt;                       where grp.Name.StartsWith&amp;#40;test&amp;#41;  &amp;#60;-- NOTE&amp;#58; Here I replaced static text with test variable&lt;br /&gt;                       select new &amp;#123; grp.Name, MemberCount &amp;#61; grp.Members.Length &amp;#125;&amp;#59;&lt;br /&gt;&lt;br /&gt;Now I get the error &amp;#39;System.NullReferenceException was unhandled&amp;#39;, the error occurs at case statement&amp;#58;&lt;br /&gt;&lt;br /&gt;                       case &amp;#34;StartsWith&amp;#34;&amp;#58;&lt;br /&gt;                            &amp;#123;&lt;br /&gt;                                ConstantExpression c &amp;#61; m.Arguments&amp;#91;0&amp;#93; as ConstantExpression&amp;#59;&lt;br /&gt;                                sb.AppendFormat&amp;#40;&amp;#34;&amp;#123;0&amp;#125;&amp;#61;&amp;#123;1&amp;#125;&amp;#42;&amp;#34;, GetFieldName&amp;#40;o.Member&amp;#41;, c.Value&amp;#41;&amp;#59; &amp;#60;--- EXCEPTION&amp;#58; on variable &amp;#39;c&amp;#39;&lt;br /&gt;                                break&amp;#59;&lt;br /&gt;                            &amp;#125;&lt;br /&gt;&lt;br /&gt;By the way thanks for this Linq class&amp;#33;&amp;#33; Excellent work&amp;#33;&lt;br /&gt;&lt;br /&gt;Yours sincerely,&lt;br /&gt;&lt;br /&gt;Evert Wiesenekker&lt;br /&gt;Comments: &lt;p&gt;The current release does what&amp;#39;s requested. A future release will do proper closure capturing and be stricter about capturing outer state in order not to give the user the impression lots of operations get remoted.&lt;/p&gt;</description><author>bdesmet</author><pubDate>Fri, 16 Jul 2010 07:02:33 GMT</pubDate><guid isPermaLink="false">Closed Issue: Error when using parameters inside where clause [2197] 20100716070233A</guid></item><item><title>Closed Feature: Suggestion: Add settings for PageSize and ClientTimeout [2191]</title><link>http://linqtoad.codeplex.com/workitem/2191</link><description>This implementation has a drawback which might cause queries to fail unneccesarily. To fix this I suggest that settings for PageSize and ClientTimout are added to allow search pagning against the directory. This will enable retrieving more than a 1000 enties at one time and allow retrieving data from slow servers. I have attached a new version of DirectorySource.cs which implements these changes.&lt;br /&gt;Comments: &lt;p&gt;The existing release has this feature. A future release will have a new design where the user has tighter control over DirectorySearcher object creation.&lt;/p&gt;</description><author>bdesmet</author><pubDate>Fri, 16 Jul 2010 07:00:13 GMT</pubDate><guid isPermaLink="false">Closed Feature: Suggestion: Add settings for PageSize and ClientTimeout [2191] 20100716070013A</guid></item><item><title>Closed Feature: Suggestion: DirectoryServicesContext [279]</title><link>http://linqtoad.codeplex.com/workitem/279</link><description>Looking at the sample, you&amp;#39;re manually creating DirectorySources, passing in a common root.  I suggest that you follow the lead of LINQ to SQL and create a DirectoryContext type which accepts the root URI, and which will auto-matically instantiate DirectorySource fields.  You could also forward the setting of the Log property if you wanted.&lt;br /&gt;&lt;br /&gt;Then you could have&amp;#58;&lt;br /&gt;&lt;br /&gt;class LocalContext&amp;#58; DirectoryServicesContext&lt;br /&gt;&amp;#123;&lt;br /&gt;    &amp;#91;DirectorySearchScope&amp;#40;SearchScope.Subtree&amp;#41;&amp;#93;&lt;br /&gt;    public DirectorySource&amp;#60;User&amp;#62; Users&amp;#59;&lt;br /&gt;&lt;br /&gt;    public LocalContext&amp;#40;string uri&amp;#41;&lt;br /&gt;    &amp;#58; base&amp;#40;uri&amp;#41; &amp;#47;&amp;#47; instantiates and stores root, instantiates Users&lt;br /&gt;    &amp;#123;&lt;br /&gt;    &amp;#125;&lt;br /&gt;&amp;#125;&lt;br /&gt;&lt;br /&gt;and&lt;br /&gt;&lt;br /&gt;static void Main&amp;#40;string&amp;#91;&amp;#93; args&amp;#41;&lt;br /&gt;&amp;#123;&lt;br /&gt;    var ldap &amp;#61; new LocalContext&amp;#40;&amp;#34;LDAP&amp;#58;&amp;#47;&amp;#47;localhost&amp;#34;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;    var res1 &amp;#61; from usr in ldap.Users select usr&amp;#59;&lt;br /&gt;&lt;br /&gt;    &amp;#47;&amp;#47; and nothing to prevent you from creating a new DirectorySource within that context&amp;#58;&lt;br /&gt;&lt;br /&gt;    var myUsers &amp;#61; ldap.GetDirectorySource&amp;#60;MyUser&amp;#62;&amp;#40;SearchScope.SubTree&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;    var res2 &amp;#61; from myUser in myUsers select myUser&amp;#59;&lt;br /&gt;&amp;#125;&lt;br /&gt;Comments: &lt;p&gt;Fixed.&lt;/p&gt;</description><author>bdesmet</author><pubDate>Fri, 16 Jul 2010 06:58:25 GMT</pubDate><guid isPermaLink="false">Closed Feature: Suggestion: DirectoryServicesContext [279] 20100716065825A</guid></item><item><title>Commented Issue: Memory Leak in DirectoryQuery.GetResults() [7443]</title><link>http://linqtoad.codeplex.com/WorkItem/View.aspx?WorkItemId=7443</link><description>The following line causes a memory leak&amp;#58;&lt;br /&gt;&amp;#34;foreach &amp;#40;SearchResult sr in s.FindAll&amp;#40;&amp;#41;&amp;#41;&amp;#34;&lt;br /&gt;&lt;br /&gt;The reason for this can be found here&amp;#58;&lt;br /&gt;http&amp;#58;&amp;#47;&amp;#47;msdn.microsoft.com&amp;#47;en-us&amp;#47;library&amp;#47;system.directoryservices.directorysearcher.findall.aspx&lt;br /&gt;&lt;br /&gt;Ultimately, any time you use a SearchResultCollection object &amp;#40;such as when you call DirectorySearcher.FindAll&amp;#41;, you must dispose the SearchResultCollection object yourself. A fix would be to put the s.FindAll&amp;#40;&amp;#41; result into a variable managed by a USING block.&lt;br /&gt;Comments: ** Comment from web user: jaxidian ** &lt;p&gt;Had wrong class name.&lt;/p&gt;</description><author>jaxidian</author><pubDate>Thu, 18 Mar 2010 19:13:47 GMT</pubDate><guid isPermaLink="false">Commented Issue: Memory Leak in DirectoryQuery.GetResults() [7443] 20100318071347P</guid></item><item><title>Created Issue: Memory Leak in DirectorySource.GetResults() [7443]</title><link>http://linqtoad.codeplex.com/WorkItem/View.aspx?WorkItemId=7443</link><description>The following line causes a memory leak&amp;#58;&lt;br /&gt;&amp;#34;foreach &amp;#40;SearchResult sr in s.FindAll&amp;#40;&amp;#41;&amp;#41;&amp;#34;&lt;br /&gt;&lt;br /&gt;The reason for this can be found here&amp;#58;&lt;br /&gt;http&amp;#58;&amp;#47;&amp;#47;msdn.microsoft.com&amp;#47;en-us&amp;#47;library&amp;#47;system.directoryservices.directorysearcher.findall.aspx&lt;br /&gt;&lt;br /&gt;Ultimately, any time you use a SearchResultCollection object &amp;#40;such as when you call DirectorySearcher.FindAll&amp;#41;, you must dispose the SearchResultCollection object yourself. A fix would be to put the s.FindAll&amp;#40;&amp;#41; result into a variable managed by a USING block.&lt;br /&gt;</description><author>jaxidian</author><pubDate>Thu, 18 Mar 2010 19:08:16 GMT</pubDate><guid isPermaLink="false">Created Issue: Memory Leak in DirectorySource.GetResults() [7443] 20100318070816P</guid></item><item><title>Commented Issue: Fixing slow query speed, Guid Filter and DateTime mapping (on linqtoad-12012.zip) [5703]</title><link>http://linqtoad.codeplex.com/WorkItem/View.aspx?WorkItemId=5703</link><description>Introduction&amp;#58;&lt;br /&gt;--------------------------&lt;br /&gt;&lt;br /&gt;First let me thank the author of this library. I am only starting to learn linq for the last three days. I am really fascinated and thinking of moving to .NET 3.5 because of this &amp;#40;I have to develop an extensive data driven application&amp;#41;. I read book chapters and looked online for examples. I was also seeking ways to integrate LDAP to linq and found this site. Out of the box, the code worked for me &amp;#40;just replaced the ROOT location to point to my AD&amp;#41;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Problem&amp;#58;&lt;br /&gt;--------------------------&lt;br /&gt;&lt;br /&gt;While using this library &amp;#40;Version&amp;#47;Name of package&amp;#58; linqtoad-12012.zip&amp;#41;, I immediately encountered the following problems&amp;#58;&lt;br /&gt;1.&amp;#9;SLOW&amp;#58; The Performance was very slow. I ran the query on an OU that returned 567 users. But this was very slow and the operation to convert to an arraylist took 34 seconds &amp;#40;average&amp;#41;.&lt;br /&gt;2.&amp;#9;GUID SEARCH&amp;#58; I can get the GUID field for a user, but when I search by GUID to locate a user, the query fails. &lt;br /&gt;3.&amp;#9;DATETIME FIELD&amp;#58; When I map a DateTime Field for example pwdLastSet, I cannot assign DateTime type.&lt;br /&gt;                a.&amp;#9; I have two options&amp;#58;&lt;br /&gt;                                 i.&amp;#9;Use the NativeObject mapping as author suggested see below&amp;#58;&lt;br /&gt;                                                          &amp;#91;DirectoryAttribute&amp;#40;&amp;#34;PasswordLastChanged&amp;#34;, DirectoryAttributeType.ActiveDs&amp;#41;&amp;#93;&lt;br /&gt;                                                          public DateTime PasswordLastSet &amp;#123; get&amp;#59; set&amp;#59; &amp;#125;&lt;br /&gt;                                 ii.&amp;#9;Use long as the data type and use a typecasting&amp;#47;conversion during every use.&lt;br /&gt;                 b.&amp;#9;But I can&amp;#8217;t do the following&amp;#58;&lt;br /&gt;                                         &amp;#91;DirectoryAttribute&amp;#40;&amp;#34;PwdLastSet&amp;#34;&amp;#41;&amp;#93;&lt;br /&gt;                                         public DateTime PasswordLastSet &amp;#123; get&amp;#59; set&amp;#59; &amp;#125;&lt;br /&gt;                 c.&amp;#9;This is not to say that the authors approach is wrong. It is infact correct. It uses ActiveDs helper object to map the datatype correctly. But the problem is speed &amp;#40;our problem 1&amp;#41;. Calls to DirectoryEntry.NativeObject is slow.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Solution&amp;#58;&lt;br /&gt;--------------------------&lt;br /&gt;A Solution to these problems is attached &amp;#40;just replace the DirectorySource.cs file of package &amp;#58;&lt;br /&gt;Readers should be aware that my understanding of LINQ is really shady at the moment. I barely have a working knowledge. I just tested my solution driven by my own need for speed, but it may as well break some functionality. So, please test the code before and after you replace the module DirectorySource.cs in linqtoad-12012.zip&amp;#41;. &lt;br /&gt;In the attached code you will find a comment with my name wherever I have applied a change. For example&amp;#58;&lt;br /&gt;&amp;#47;&amp;#47; &amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42; Code Modified &amp;#40;Commented by&amp;#58; Russel Ahmed Apu, russel_ahmed_apu &amp;#64; hotmail dot com&amp;#41; &amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&lt;br /&gt;&amp;#47;&amp;#47; Disable this because we dont want to call GetDirectoryEntry&amp;#40;&amp;#41; if we dont need it&lt;br /&gt;&amp;#47;&amp;#47;DirectoryEntry e &amp;#61; sr.GetDirectoryEntry&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#47;&amp;#47; &amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42; END Of Modification &amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&lt;br /&gt;&lt;br /&gt;So, if you don&amp;#8217;t want a certain change you can certainly go back to the old code. Please use your judgment and always test your code. &lt;br /&gt;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&lt;br /&gt;USING THE CHANGES PROPOSED BELOW, &lt;br /&gt;I MANAGED TO SPEEDUP A QUERY THAT TOOK &amp;#42;34&amp;#42; SECONDS &lt;br /&gt;TO &amp;#42;0.25&amp;#42; SECONDS&amp;#33;&amp;#33;&amp;#33;&lt;br /&gt;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&lt;br /&gt;Also, I can now map DateTime and Guid fields accordingly.&lt;br /&gt;I can also search by guid objects, like this&amp;#58;&lt;br /&gt;In Entity.cs&lt;br /&gt;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&lt;br /&gt;...&lt;br /&gt;&amp;#91;DirectoryAttribute&amp;#40;&amp;#34;objectGUID&amp;#34;&amp;#41;&amp;#93;&lt;br /&gt;public Guid Id &amp;#123; get&amp;#59; set&amp;#59; &amp;#125;&lt;br /&gt;&amp;#91;DirectoryAttribute&amp;#40;&amp;#34;PwdLastSet&amp;#34;&amp;#41;&amp;#93;&lt;br /&gt;public DateTime PasswordLastSet &amp;#123; get&amp;#59; set&amp;#59; &amp;#125;&lt;br /&gt;...&lt;br /&gt;In Program.cs&lt;br /&gt;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&lt;br /&gt;...&lt;br /&gt;Guid myguid &amp;#61; new Guid&amp;#40;&amp;#34;39267f96-e560-49dc-884c-4f036f78be0b&amp;#34;&amp;#41;&amp;#59;&lt;br /&gt;var AllUsers &amp;#61; from usr in dtx.Canada.Users where usr.ObjectCategory &amp;#61;&amp;#61; &amp;#34;Person&amp;#34; &amp;#38;&amp;#38; usr.Id&amp;#61;&amp;#61;myguid select usr&amp;#59;&lt;br /&gt;foreach &amp;#40;var u in AllUsers&amp;#41;&lt;br /&gt;&amp;#123;&lt;br /&gt;   Console.WriteLine&amp;#40;&amp;#34;&amp;#123;0&amp;#125;  -  &amp;#123;1&amp;#125;&amp;#34;,u.Name, u.Id&amp;#41;&amp;#59;&lt;br /&gt;&amp;#125;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Explanation For Speedup&amp;#58;&lt;br /&gt;-----------------------------&lt;br /&gt;The reason for this slow speed is the call to SearchResult.GetDirectoryEntry&amp;#40;&amp;#41;. This method is called from Method GetResults&amp;#40;&amp;#41; and AssignResultPropery&amp;#40;&amp;#41; methods implemented by the original author. The AD GetDirectoryEntry is called to retrieve every single property, so it&amp;#8217;s called many times for each query row. &lt;br /&gt;To resolve this issue, I took an alternative track. I initialized the DirectorySearcher object by adding s.PropertiesToLoad.Add&amp;#40;&amp;#8230;&amp;#41; method calls for every properties that must be extracted from AD. I removed calls to GetDirectoryEntry whenever possible and instead used SearchResult.Properties&amp;#91;&amp;#93; to get  the property values directly from the SearchResult object. This makes information retrieval very fast.&lt;br /&gt;The only places where GetDirectoryEntry is needed is when you want to apply changes to certain objects and need to map properties using the ActiveDs helper object &amp;#40;i.e. PasswordLastChanged&amp;#41;. Thus, if you can avoid nativeobject, this MOD will be very fast &amp;#40;It will be slower for updates&amp;#41;.&lt;br /&gt;Comments: ** Comment from web user: lookitstony ** &lt;p&gt;Thanks&amp;#33; I just implemented all the changes. My site still works&amp;#33; Thanks&amp;#33;&lt;/p&gt;</description><author>lookitstony</author><pubDate>Fri, 08 Jan 2010 18:47:52 GMT</pubDate><guid isPermaLink="false">Commented Issue: Fixing slow query speed, Guid Filter and DateTime mapping (on linqtoad-12012.zip) [5703] 20100108064752P</guid></item><item><title>Commented Issue: Equals on ParsePredicate [3656]</title><link>http://linqtoad.codeplex.com/WorkItem/View.aspx?WorkItemId=3656</link><description>I notice that on Function ParsePredicate of DirectorySource missing Equals. There are Contains, StartWith and EndWith, obvioulsy  is simple to implement&lt;br /&gt;                            &lt;br /&gt;                            case &amp;#34;Equals&amp;#34;&amp;#58;&lt;br /&gt;                            &amp;#123;&lt;br /&gt;                                string value &amp;#61; GetStringOperandValue&amp;#40;m&amp;#41;&amp;#59;&lt;br /&gt;                                sb.AppendFormat&amp;#40;&amp;#34;&amp;#123;0&amp;#125;&amp;#61;&amp;#123;1&amp;#125;&amp;#34;, GetFieldName&amp;#40;o.Member&amp;#41;, value&amp;#41;&amp;#59;&lt;br /&gt;                                break&amp;#59;&lt;br /&gt;                            &amp;#125;&lt;br /&gt;Thanks&lt;br /&gt;Comments: ** Comment from web user: lookitstony ** &lt;p&gt;Thanks&amp;#33;&lt;/p&gt;</description><author>lookitstony</author><pubDate>Fri, 08 Jan 2010 18:16:13 GMT</pubDate><guid isPermaLink="false">Commented Issue: Equals on ParsePredicate [3656] 20100108061613P</guid></item><item><title>Commented Issue: directory attribute update fails when value is String.Empty [4219]</title><link>http://linqtoad.codeplex.com/WorkItem/View.aspx?WorkItemId=4219</link><description>Hope this will help someone else as well.&lt;br /&gt;For example if you clear the address details of a user and update the context, DirectoryEntry CommitChanges will fail.&lt;br /&gt;There are two work arounds for this issue - in your higher level classes &amp;#40;Entity or even higher&amp;#41; check if value is &amp;#34;&amp;#34; &amp;#92; string.empty and change it to null.&lt;br /&gt;&lt;br /&gt;2nd option&amp;#58; In DirectorySource class inside Update&amp;#40;&amp;#41; method&amp;#58;&lt;br /&gt;replace instances of     i.GetValue&amp;#40;e.Key, null&amp;#41;       with&lt;br /&gt;&amp;#40;i.GetValue&amp;#40;e.Key, null&amp;#41;&amp;#61;&amp;#61;String.Empty&amp;#63;null&amp;#58;i.GetValue&amp;#40;e.Key, null&amp;#41;&amp;#41;&lt;br /&gt;&lt;br /&gt;this should correct the issue from a lower level class.&lt;br /&gt;&lt;br /&gt;Please note i have NOT tested this for attributes which as of ActiveDS type.&lt;br /&gt;&lt;br /&gt;regards&lt;br /&gt;&lt;br /&gt;afraan&lt;br /&gt;Comments: ** Comment from web user: lookitstony ** &lt;p&gt;Thanks&amp;#33; I can see where this would have been an issue for me.&lt;/p&gt;</description><author>lookitstony</author><pubDate>Fri, 08 Jan 2010 18:11:08 GMT</pubDate><guid isPermaLink="false">Commented Issue: directory attribute update fails when value is String.Empty [4219] 20100108061108P</guid></item><item><title>Created Issue: Queries fail when using special characters [6421]</title><link>http://linqtoad.codeplex.com/WorkItem/View.aspx?WorkItemId=6421</link><description>I had to search for displayName&amp;#39;s which started with a &amp;#34;&amp;#40;&amp;#34;. LDAP query syntax uses parenthesis and therefore can&amp;#39;t handle this without replacing that and other special characters with the escape sequence substitutes &amp;#40;http&amp;#58;&amp;#47;&amp;#47;msdn.microsoft.com&amp;#47;en-us&amp;#47;library&amp;#47;aa746475&amp;#37;28VS.85&amp;#37;29.aspx&amp;#41;&lt;br /&gt;&lt;br /&gt;I added the following function to my copy of DirectorySource.cs&lt;br /&gt;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;summary&amp;#62;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; Replaces the special characters.&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;&amp;#47;summary&amp;#62;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;param name&amp;#61;&amp;#34;constantValue&amp;#34;&amp;#62;The constant value.&amp;#60;&amp;#47;param&amp;#62;&lt;br /&gt;        &amp;#47;&amp;#47;&amp;#47; &amp;#60;returns&amp;#62;&amp;#60;&amp;#47;returns&amp;#62;&lt;br /&gt;        private object ReplaceSpecialCharacters&amp;#40;object constantValue&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            if &amp;#40;constantValue is string&amp;#41;&lt;br /&gt;            &amp;#123;&lt;br /&gt;                StringBuilder returnValue &amp;#61; new StringBuilder&amp;#40;&amp;#40;string&amp;#41;constantValue&amp;#41;&amp;#59;&lt;br /&gt;                returnValue &amp;#61; returnValue.Replace&amp;#40;&amp;#64;&amp;#34;&amp;#92;&amp;#34;, &amp;#64;&amp;#34;&amp;#92;5c&amp;#34;&amp;#41;&amp;#59;&lt;br /&gt;                returnValue &amp;#61; returnValue.Replace&amp;#40;&amp;#64;&amp;#34;&amp;#42;&amp;#34;, &amp;#64;&amp;#34;&amp;#92;2a&amp;#34;&amp;#41;&amp;#59;&lt;br /&gt;                returnValue &amp;#61; returnValue.Replace&amp;#40;&amp;#64;&amp;#34;&amp;#40;&amp;#34;, &amp;#64;&amp;#34;&amp;#92;28&amp;#34;&amp;#41;&amp;#59;&lt;br /&gt;                returnValue &amp;#61; returnValue.Replace&amp;#40;&amp;#64;&amp;#34;&amp;#41;&amp;#34;, &amp;#64;&amp;#34;&amp;#92;29&amp;#34;&amp;#41;&amp;#59;&lt;br /&gt;                returnValue &amp;#61; returnValue.Replace&amp;#40;&amp;#64;&amp;#34;&amp;#47;&amp;#34;, &amp;#64;&amp;#34;&amp;#92;00&amp;#34;&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;                return returnValue.ToString&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;            &amp;#125;&lt;br /&gt;            return constantValue&amp;#59;&lt;br /&gt;        &amp;#125;&lt;br /&gt;&lt;br /&gt;And then modified ParsePredicate to contain the following&amp;#58;&lt;br /&gt;&lt;br /&gt;                    switch &amp;#40;m.Method.Name&amp;#41;&lt;br /&gt;                    &amp;#123;&lt;br /&gt;                        case &amp;#34;Contains&amp;#34;&amp;#58;&lt;br /&gt;                            &amp;#123;&lt;br /&gt;                                ConstantExpression c &amp;#61; m.Arguments&amp;#91;0&amp;#93; as ConstantExpression&amp;#59;&lt;br /&gt;                                sb.AppendFormat&amp;#40;&amp;#34;&amp;#123;0&amp;#125;&amp;#61;&amp;#42;&amp;#123;1&amp;#125;&amp;#42;&amp;#34;, GetFieldName&amp;#40;o.Member&amp;#41;, ReplaceSpecialCharacters&amp;#40;c.Value&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                                break&amp;#59;&lt;br /&gt;                            &amp;#125;&lt;br /&gt;                        case &amp;#34;StartsWith&amp;#34;&amp;#58;&lt;br /&gt;                            &amp;#123;&lt;br /&gt;                                ConstantExpression c &amp;#61; m.Arguments&amp;#91;0&amp;#93; as ConstantExpression&amp;#59;&lt;br /&gt;                                sb.AppendFormat&amp;#40;&amp;#34;&amp;#123;0&amp;#125;&amp;#61;&amp;#123;1&amp;#125;&amp;#42;&amp;#34;, GetFieldName&amp;#40;o.Member&amp;#41;, ReplaceSpecialCharacters&amp;#40;c.Value&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                                break&amp;#59;&lt;br /&gt;                            &amp;#125;&lt;br /&gt;                        case &amp;#34;EndsWith&amp;#34;&amp;#58;&lt;br /&gt;                            &amp;#123;&lt;br /&gt;                                ConstantExpression c &amp;#61; m.Arguments&amp;#91;0&amp;#93; as ConstantExpression&amp;#59;&lt;br /&gt;                                sb.AppendFormat&amp;#40;&amp;#34;&amp;#123;0&amp;#125;&amp;#61;&amp;#42;&amp;#123;1&amp;#125;&amp;#34;, GetFieldName&amp;#40;o.Member&amp;#41;, ReplaceSpecialCharacters&amp;#40;c.Value&amp;#41;&amp;#41;&amp;#59;&lt;br /&gt;                                break&amp;#59;&lt;br /&gt;                            &amp;#125;&lt;br /&gt;                        default&amp;#58;&lt;br /&gt;                            throw new NotSupportedException&amp;#40;&amp;#34;Unsupported string filtering query expression detected. Cannot translate to LDAP equivalent.&amp;#34;&amp;#41;&amp;#59;&lt;br /&gt;                    &amp;#125;&lt;br /&gt;</description><author>Wonovan</author><pubDate>Mon, 30 Nov 2009 16:02:50 GMT</pubDate><guid isPermaLink="false">Created Issue: Queries fail when using special characters [6421] 20091130040250P</guid></item><item><title>Created Issue: Trying to get all users in a group is limited to 1500 records [6172]</title><link>http://linqtoad.codeplex.com/WorkItem/View.aspx?WorkItemId=6172</link><description>When I do a query to get all users in a group like the one below &amp;#40;where &amp;#34;MyGroups&amp;#34; is AD Groups&amp;#41;&amp;#58;&lt;br /&gt;                var res &amp;#61; from i in ctx.MyGroups&lt;br /&gt;                          where i.Name &amp;#61;&amp;#61; GroupName&lt;br /&gt;                          select i.Members&amp;#59;&lt;br /&gt;The results are limited to 1500 records.  I believe there is some way to get around this limitation of the Directory Searcher using the &amp;#34;range&amp;#34;&amp;#58; &lt;br /&gt;&lt;br /&gt;DirectorySearcher groupMember &amp;#61; new DirectorySearcher&lt;br /&gt;    &amp;#40;group,&amp;#34;&amp;#40;objectClass&amp;#61;&amp;#42;&amp;#41;&amp;#34;,new string&amp;#91;&amp;#93;&amp;#123;&amp;#34;member&amp;#59;Range&amp;#61;0-500&amp;#34;&amp;#125;,SearchScope.Base&amp;#41;&amp;#59;&lt;br /&gt; &amp;#40;http&amp;#58;&amp;#47;&amp;#47;bcheul.tistory.com&amp;#47;archive&amp;#47;200811&amp;#41;&lt;br /&gt;&lt;br /&gt;It would be nice if your LINQ provider knew when it had hit 1500, then did another query for the next 1500 and so on until it had all users, then merged the results into the one list.  At the moment I am going to have to try and do this manually.&lt;br /&gt;</description><author>nootn</author><pubDate>Mon, 09 Nov 2009 02:12:44 GMT</pubDate><guid isPermaLink="false">Created Issue: Trying to get all users in a group is limited to 1500 records [6172] 20091109021244A</guid></item><item><title>Created Issue: Fixing slow query speed, Guid Filter and DateTime mapping [5703]</title><link>http://linqtoad.codeplex.com/WorkItem/View.aspx?WorkItemId=5703</link><description>Introduction&amp;#58;&lt;br /&gt;--------------------------&lt;br /&gt;&lt;br /&gt;First let me thank the author of this library. I am only starting to learn linq for the last three days. I am really fascinated and thinking of moving to .NET 3.5 because of this &amp;#40;I have to develop an extensive data driven application&amp;#41;. I read book chapters and looked online for examples. I was also seeking ways to integrate LDAP to linq and found this site. Out of the box, the code worked for me &amp;#40;just replaced the ROOT location to point to my AD&amp;#41;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Problem&amp;#58;&lt;br /&gt;--------------------------&lt;br /&gt;&lt;br /&gt;While using this library &amp;#40;Version&amp;#47;Name of package&amp;#58; linqtoad-12012.zip&amp;#41;, I immediately encountered the following problems&amp;#58;&lt;br /&gt;1.&amp;#9;SLOW&amp;#58; The Performance was very slow. I ran the query on an OU that returned 567 users. But this was very slow and the operation to convert to an arraylist took 34 seconds &amp;#40;average&amp;#41;.&lt;br /&gt;2.&amp;#9;GUID SEARCH&amp;#58; I can get the GUID field for a user, but when I search by GUID to locate a user, the query fails. &lt;br /&gt;3.&amp;#9;DATETIME FIELD&amp;#58; When I map a DateTime Field for example pwdLastSet, I cannot assign DateTime type.&lt;br /&gt;                a.&amp;#9; I have two options&amp;#58;&lt;br /&gt;                                 i.&amp;#9;Use the NativeObject mapping as author suggested see below&amp;#58;&lt;br /&gt;                                                          &amp;#91;DirectoryAttribute&amp;#40;&amp;#34;PasswordLastChanged&amp;#34;, DirectoryAttributeType.ActiveDs&amp;#41;&amp;#93;&lt;br /&gt;                                                          public DateTime PasswordLastSet &amp;#123; get&amp;#59; set&amp;#59; &amp;#125;&lt;br /&gt;                                 ii.&amp;#9;Use long as the data type and use a typecasting&amp;#47;conversion during every use.&lt;br /&gt;                 b.&amp;#9;But I can&amp;#8217;t do the following&amp;#58;&lt;br /&gt;                                         &amp;#91;DirectoryAttribute&amp;#40;&amp;#34;PwdLastSet&amp;#34;&amp;#41;&amp;#93;&lt;br /&gt;                                         public DateTime PasswordLastSet &amp;#123; get&amp;#59; set&amp;#59; &amp;#125;&lt;br /&gt;                 c.&amp;#9;This is not to say that the authors approach is wrong. It is infact correct. It uses ActiveDs helper object to map the datatype correctly. But the problem is speed &amp;#40;our problem 1&amp;#41;. Calls to DirectoryEntry.NativeObject is slow.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Solution&amp;#58;&lt;br /&gt;--------------------------&lt;br /&gt;A Solution to these problems is attached &amp;#40;just replace the DirectorySource.cs file of package &amp;#58;&lt;br /&gt;Readers should be aware that my understanding of LINQ is really shady at the moment. I barely have a working knowledge. I just tested my solution driven by my own need for speed, but it may as well break some functionality. So, please test the code before and after you replace the module DirectorySource.cs in linqtoad-12012.zip&amp;#41;. &lt;br /&gt;In the attached code you will find a comment with my name wherever I have applied a change. For example&amp;#58;&lt;br /&gt;&amp;#47;&amp;#47; &amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42; Code Modified &amp;#40;Commented by&amp;#58; Russel Ahmed Apu, russel_ahmed_apu &amp;#64; hotmail dot com&amp;#41; &amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&lt;br /&gt;&amp;#47;&amp;#47; Disable this because we dont want to call GetDirectoryEntry&amp;#40;&amp;#41; if we dont need it&lt;br /&gt;&amp;#47;&amp;#47;DirectoryEntry e &amp;#61; sr.GetDirectoryEntry&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;&amp;#47;&amp;#47; &amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42; END Of Modification &amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&lt;br /&gt;&lt;br /&gt;So, if you don&amp;#8217;t want a certain change you can certainly go back to the old code. Please use your judgment and always test your code. &lt;br /&gt;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&lt;br /&gt;USING THE CHANGES PROPOSED BELOW, &lt;br /&gt;I MANAGED TO SPEEDUP A QUERY THAT TOOK &amp;#42;34&amp;#42; SECONDS &lt;br /&gt;TO &amp;#42;0.25&amp;#42; SECONDS&amp;#33;&amp;#33;&amp;#33;&lt;br /&gt;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&amp;#42;&lt;br /&gt;Also, I can now map DateTime and Guid fields accordingly.&lt;br /&gt;I can also search by guid objects, like this&amp;#58;&lt;br /&gt;In Entity.cs&lt;br /&gt;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&lt;br /&gt;...&lt;br /&gt;&amp;#91;DirectoryAttribute&amp;#40;&amp;#34;objectGUID&amp;#34;&amp;#41;&amp;#93;&lt;br /&gt;public Guid Id &amp;#123; get&amp;#59; set&amp;#59; &amp;#125;&lt;br /&gt;&amp;#91;DirectoryAttribute&amp;#40;&amp;#34;PwdLastSet&amp;#34;&amp;#41;&amp;#93;&lt;br /&gt;public DateTime PasswordLastSet &amp;#123; get&amp;#59; set&amp;#59; &amp;#125;&lt;br /&gt;...&lt;br /&gt;In Program.cs&lt;br /&gt;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&amp;#126;&lt;br /&gt;...&lt;br /&gt;Guid myguid &amp;#61; new Guid&amp;#40;&amp;#34;39267f96-e560-49dc-884c-4f036f78be0b&amp;#34;&amp;#41;&amp;#59;&lt;br /&gt;var AllUsers &amp;#61; from usr in dtx.Canada.Users where usr.ObjectCategory &amp;#61;&amp;#61; &amp;#34;Person&amp;#34; &amp;#38;&amp;#38; usr.Id&amp;#61;&amp;#61;myguid select usr&amp;#59;&lt;br /&gt;foreach &amp;#40;var u in AllUsers&amp;#41;&lt;br /&gt;&amp;#123;&lt;br /&gt;   Console.WriteLine&amp;#40;&amp;#34;&amp;#123;0&amp;#125;  -  &amp;#123;1&amp;#125;&amp;#34;,u.Name, u.Id&amp;#41;&amp;#59;&lt;br /&gt;&amp;#125;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Explanation For Speedup&amp;#58;&lt;br /&gt;-----------------------------&lt;br /&gt;The reason for this slow speed is the call to SearchResult.GetDirectoryEntry&amp;#40;&amp;#41;. This method is called from Method GetResults&amp;#40;&amp;#41; and AssignResultPropery&amp;#40;&amp;#41; methods implemented by the original author. The AD GetDirectoryEntry is called to retrieve every single property, so it&amp;#8217;s called many times for each query row. &lt;br /&gt;To resolve this issue, I took an alternative track. I initialized the DirectorySearcher object by adding s.PropertiesToLoad.Add&amp;#40;&amp;#8230;&amp;#41; method calls for every properties that must be extracted from AD. I removed calls to GetDirectoryEntry whenever possible and instead used SearchResult.Properties&amp;#91;&amp;#93; to get  the property values directly from the SearchResult object. This makes information retrieval very fast.&lt;br /&gt;The only places where GetDirectoryEntry is needed is when you want to apply changes to certain objects and need to map properties using the ActiveDs helper object &amp;#40;i.e. PasswordLastChanged&amp;#41;. Thus, if you can avoid nativeobject, this MOD will be very fast &amp;#40;It will be slower for updates&amp;#41;.&lt;br /&gt;</description><author>rapu</author><pubDate>Fri, 02 Oct 2009 18:16:47 GMT</pubDate><guid isPermaLink="false">Created Issue: Fixing slow query speed, Guid Filter and DateTime mapping [5703] 20091002061647P</guid></item><item><title>Commented Issue: COM Exception Unhandled: DirectorySource.cs</title><link>http://linqtoad.codeplex.com/WorkItem/View.aspx?WorkItemId=3829</link><description>Just downloaded the project, but I can&amp;#39;t run it. Getting this error in the DirectorySource.GetResults&amp;#40;&amp;#41; method. Shouldn&amp;#39;t the COM server be registered when the project is compiled&amp;#63;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;System.Runtime.InteropServices.COMException was unhandled&lt;br /&gt;  Message&amp;#61;&amp;#34;The server is not operational.&amp;#92;r&amp;#92;n&amp;#34;&lt;br /&gt;  Source&amp;#61;&amp;#34;System.DirectoryServices&amp;#34;&lt;br /&gt;  ErrorCode&amp;#61;-2147016646&lt;br /&gt;  StackTrace&amp;#58;&lt;br /&gt;       at System.DirectoryServices.DirectoryEntry.Bind&amp;#40;Boolean throwIfFail&amp;#41;&lt;br /&gt;       at System.DirectoryServices.DirectoryEntry.Bind&amp;#40;&amp;#41;&lt;br /&gt;       at System.DirectoryServices.DirectoryEntry.get_AdsObject&amp;#40;&amp;#41;&lt;br /&gt;       at System.DirectoryServices.DirectorySearcher.FindAll&amp;#40;Boolean findMoreThanOne&amp;#41;&lt;br /&gt;       at System.DirectoryServices.DirectorySearcher.FindAll&amp;#40;&amp;#41;&lt;br /&gt;       at BdsSoft.DirectoryServices.Linq.DirectoryQuery&amp;#96;1.&amp;#60;GetResults&amp;#62;d__0.MoveNext&amp;#40;&amp;#41; in C&amp;#58;&amp;#92;CGI&amp;#92;LINQtoAD CodePlex Release&amp;#92;BdsSoft.DirectoryServices.Linq&amp;#92;DirectorySource.cs&amp;#58;line 361&lt;br /&gt;       at Demo.Program.Main&amp;#40;String&amp;#91;&amp;#93; args&amp;#41; in C&amp;#58;&amp;#92;CGI&amp;#92;LINQtoAD CodePlex Release&amp;#92;Demo&amp;#92;Program.cs&amp;#58;line 47&lt;br /&gt;       at System.AppDomain._nExecuteAssembly&amp;#40;Assembly assembly, String&amp;#91;&amp;#93; args&amp;#41;&lt;br /&gt;       at System.AppDomain.ExecuteAssembly&amp;#40;String assemblyFile, Evidence assemblySecurity, String&amp;#91;&amp;#93; args&amp;#41;&lt;br /&gt;       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly&amp;#40;&amp;#41;&lt;br /&gt;       at System.Threading.ThreadHelper.ThreadStart_Context&amp;#40;Object state&amp;#41;&lt;br /&gt;       at System.Threading.ExecutionContext.Run&amp;#40;ExecutionContext executionContext, ContextCallback callback, Object state&amp;#41;&lt;br /&gt;       at System.Threading.ThreadHelper.ThreadStart&amp;#40;&amp;#41;&lt;br /&gt;  InnerException&amp;#58;&lt;br /&gt;Comments: ** Comment from web user: holyhandgrenade ** &lt;p&gt;If you haven&amp;#39;t found your issue&amp;#59; the following message&amp;#58;&lt;/p&gt;&lt;p&gt;Message&amp;#61;&amp;#34;The server is not operational.&amp;#92;r&amp;#92;n&amp;#34;&lt;/p&gt;&lt;p&gt;Means that the active directory domain specified did not respond to the query. You do have to be connected to an Active Directory domain, and any time you see the LDAP&amp;#58;&amp;#47;&amp;#47; it has to be followed by a domain controller.&lt;/p&gt;</description><author>holyhandgrenade</author><pubDate>Sun, 14 Jun 2009 06:36:26 GMT</pubDate><guid isPermaLink="false">Commented Issue: COM Exception Unhandled: DirectorySource.cs 20090614063626A</guid></item><item><title>Commented Issue: directory attribute update fails when value is String.Empty</title><link>http://linqtoad.codeplex.com/WorkItem/View.aspx?WorkItemId=4219</link><description>Hope this will help someone else as well.&lt;br /&gt;For example if you clear the address details of a user and update the context, DirectoryEntry CommitChanges will fail.&lt;br /&gt;There are two work arounds for this issue - in your higher level classes &amp;#40;Entity or even higher&amp;#41; check if value is &amp;#34;&amp;#34; &amp;#92; string.empty and change it to null.&lt;br /&gt;&lt;br /&gt;2nd option&amp;#58; In DirectorySource class inside Update&amp;#40;&amp;#41; method&amp;#58;&lt;br /&gt;replace instances of     i.GetValue&amp;#40;e.Key, null&amp;#41;       with&lt;br /&gt;&amp;#40;i.GetValue&amp;#40;e.Key, null&amp;#41;&amp;#61;&amp;#61;String.Empty&amp;#63;null&amp;#58;i.GetValue&amp;#40;e.Key, null&amp;#41;&amp;#41;&lt;br /&gt;&lt;br /&gt;this should correct the issue from a lower level class.&lt;br /&gt;&lt;br /&gt;Please note i have NOT tested this for attributes which as of ActiveDS type.&lt;br /&gt;&lt;br /&gt;regards&lt;br /&gt;&lt;br /&gt;afraan&lt;br /&gt;Comments: ** Comment from web user: rauh_ryan ** &lt;p&gt;I&amp;#39;ve ran into the exact same issue&lt;/p&gt;</description><author>rauh_ryan</author><pubDate>Mon, 08 Jun 2009 21:48:38 GMT</pubDate><guid isPermaLink="false">Commented Issue: directory attribute update fails when value is String.Empty 20090608094838P</guid></item><item><title>Commented Issue: directory attribute update fails when value is String.Empty</title><link>http://linqtoad.codeplex.com/WorkItem/View.aspx?WorkItemId=4219</link><description>Hope this will help someone else as well.&lt;br /&gt;For example if you clear the address details of a user and update the context, DirectoryEntry CommitChanges will fail.&lt;br /&gt;There are two work arounds for this issue - in your higher level classes &amp;#40;Entity or even higher&amp;#41; check if value is &amp;#34;&amp;#34; &amp;#92; string.empty and change it to null.&lt;br /&gt;&lt;br /&gt;2nd option&amp;#58; In DirectorySource class inside Update&amp;#40;&amp;#41; method&amp;#58;&lt;br /&gt;replace instances of     i.GetValue&amp;#40;e.Key, null&amp;#41;       with&lt;br /&gt;&amp;#40;i.GetValue&amp;#40;e.Key, null&amp;#41;&amp;#61;&amp;#61;String.Empty&amp;#63;null&amp;#58;i.GetValue&amp;#40;e.Key, null&amp;#41;&amp;#41;&lt;br /&gt;&lt;br /&gt;this should correct the issue from a lower level class.&lt;br /&gt;&lt;br /&gt;Please note i have NOT tested this for attributes which as of ActiveDS type.&lt;br /&gt;&lt;br /&gt;regards&lt;br /&gt;&lt;br /&gt;afraan&lt;br /&gt;Comments: ** Comment from web user: afraan ** &lt;p&gt;acutally might get compile type warnings so changed code to the following&amp;#58;&lt;/p&gt;&lt;p&gt;&amp;#40;i.PropertyType&amp;#61;&amp;#61;typeof&amp;#40;String&amp;#41;&amp;#38;&amp;#38; &amp;#40;&amp;#40;String&amp;#41;i.GetValue&amp;#40;e.Key, null&amp;#41;&amp;#41;&amp;#61;&amp;#61;String.Empty&amp;#63;null&amp;#58;i.GetValue&amp;#40;e.Key, null&amp;#41;&amp;#41;&lt;/p&gt;</description><author>afraan</author><pubDate>Thu, 09 Apr 2009 04:37:10 GMT</pubDate><guid isPermaLink="false">Commented Issue: directory attribute update fails when value is String.Empty 20090409043710A</guid></item><item><title>Created Issue: directory attribute update fails when value is String.Empty</title><link>http://linqtoad.codeplex.com/WorkItem/View.aspx?WorkItemId=4219</link><description>Hope this will help someone else as well.&lt;br /&gt;For example if you clear the address details of a user and update the context, DirectoryEntry CommitChanges will fail.&lt;br /&gt;There are two work arounds for this issue - in your higher level classes &amp;#40;Entity or even higher&amp;#41; check if value is &amp;#34;&amp;#34; &amp;#92; string.empty and change it to null.&lt;br /&gt;&lt;br /&gt;2nd option&amp;#58; In DirectorySource class inside Update&amp;#40;&amp;#41; method&amp;#58;&lt;br /&gt;replace instances of     i.GetValue&amp;#40;e.Key, null&amp;#41;       with&lt;br /&gt;&amp;#40;i.GetValue&amp;#40;e.Key, null&amp;#41;&amp;#61;&amp;#61;String.Empty&amp;#63;null&amp;#58;i.GetValue&amp;#40;e.Key, null&amp;#41;&amp;#41;&lt;br /&gt;&lt;br /&gt;this should correct the issue from a lower level class.&lt;br /&gt;&lt;br /&gt;Please note i have NOT tested this for attributes which as of ActiveDS type.&lt;br /&gt;&lt;br /&gt;regards&lt;br /&gt;&lt;br /&gt;afraan&lt;br /&gt;</description><author>afraan</author><pubDate>Thu, 09 Apr 2009 04:05:31 GMT</pubDate><guid isPermaLink="false">Created Issue: directory attribute update fails when value is String.Empty 20090409040531A</guid></item></channel></rss>