Looking at the sample, you'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.
Then you could have:
class LocalContext: DirectoryServicesContext
{
[DirectorySearchScope(SearchScope.Subtree)]
public DirectorySource<User> Users;
public LocalContext(string uri)
: base(uri) // instantiates and stores root, instantiates Users
{
}
}
and
static void Main(string[] args)
{
var ldap = new LocalContext("LDAP://localhost");
var res1 = from usr in ldap.Users select usr;
// and nothing to prevent you from creating a new DirectorySource within that context:
var myUsers = ldap.GetDirectorySource<MyUser>(SearchScope.SubTree);
var res2 = from myUser in myUsers select myUser;
}