private string CreateFilter(Type entryType, EntryCollectionPropertyAttribute propertyAttribute) { var builder = new FilterBuilder(entryType); var attributeBuilder = builder.CreateBuilder(); var attribute = entryType.AssertGetAttribute <DirectoryTypeAttribute>(); attributeBuilder.AddObjectClass(attribute.Name); if (propertyAttribute.MatchingRule != MatchingRuleType.Children) { // Example AttributeName: "member:1.2.840.113556.1.4.1941:" var attributeName = string.Concat(propertyAttribute.Name, propertyAttribute.MatchingRuleValue); attributeBuilder.AddAttribute(attributeName, FilterOperator.Equals, _entryObject.InternalDn); } builder.AddBuilder(attributeBuilder); return(builder.ToString()); }
private IEnumerator <TEntry> GetEntryEnumerator(IQueryExecutor queryExecutor, EntryCollectionPropertyAttribute propertyAttribute, string filter) { if (propertyAttribute.MatchingRule == MatchingRuleType.Children) { return(queryExecutor.ExecuteQuery <TEntry>(_entryObject.Entry, propertyAttribute.Scope, filter)); } return(queryExecutor.ExecuteQuery <TEntry>(filter)); }