public DirectoryEnumerator <T> Translate <T>(TranslatorContext context) { var directorySearch = context.DirectorySearcher; directorySearch.Filter = Parse(context).ToString(); return(new DirectoryEnumerator <T>(context, ResultMapper, context.FindAll())); }
public object TranslateOne(TranslatorContext context) { var directorySearch = context.DirectorySearcher; var origionalType = context.Expression.GetOrigionalType(); directorySearch.Filter = Parse(context).ToString(); if (context.Expression.NodeType.Is(DirectoryExpressionType.SingleResult)) { var singleResultExpression = (SingleResultExpression)context.Expression; if (singleResultExpression.SingleResultType == SingleResultType.Count) { return(((SearchResults)context.FindAll()).Count); } } return(ResultMapper.Map(origionalType, context.FindOne())); }
public DirectoryEnumerator <T> Translate <T>(DirectorySearcher searcher) { var context = new TranslatorContext(searcher); return(new DirectoryEnumerator <T>(context, ResultMapper, context.FindAll())); }