/// <summary> /// Executes the strongly-typed query represented by a specified expression tree. /// </summary> /// <returns> /// The value that results from executing the specified query. /// </returns> /// <param name="entry"></param> /// <param name="expression">An expression tree that represents a LINQ query.</param><typeparam name="TResult">The type of the value that results from executing the query.</typeparam> public virtual TResult Execute <TResult>(EntryObject entry, Expression expression) { var queryState = new EntryQueryState(Context, typeof(TResult), expression); var directoryExpression = queryState.GetSingleResultExpression(); return(Context.QueryExecutor.Execute <TResult>(entry.Entry, _scope, directoryExpression)); }
public EntrySetCollection(EntryObject entryObject, PropertyInfo property) : base(entryObject.Context) { _entryObject = entryObject; _property = property; var attribute = _property.GetAttribute <EntryCollectionPropertyAttribute>(); if (attribute != null) { _scope = attribute.Scope; } }
public void SetParent(EntryObject parent) { if (parent == null) { throw new ArgumentNullException("parent"); } if (Parent == parent) { return; } Parent = parent; //SetParent(GetCnValue(), parent); }
public bool Add(EntryObject obj) { if (obj != null && obj.Entry != null) { var addUserResult = Entry.Invoke("Add", obj.Entry.Path); var result = addUserResult == null; if (!result) { Marshal.ReleaseComObject(addUserResult); } return(result); } return(false); }
public bool Remove(EntryObject obj) { if (obj != null && obj.Entry != null) { var removeUserResult = Entry.Invoke("Remove", obj.Entry.Path); var result = removeUserResult == null; if (!result) { Marshal.ReleaseComObject(removeUserResult); } return(result); } return(false); }
public EntrySetCollection(EntryObject entryObject, PropertyInfo property) : base(entryObject.Context) { _entryObject = entryObject; _property = property; }
public EntrySetCollectionQueryState(DirectoryContext context, EntryObject entry, SearchScope scope, Type entryType, Expression expression) : base(context, entryType, expression) { Scope = scope; EntryObject = entry; }
public EntryCollection(EntryObject entryObject, PropertyInfo property) { _entryObject = entryObject; _property = property; }
/// <summary> /// Constructs an <see cref="T:System.Linq.IQueryable`1"/> object that can evaluate the query represented by a specified expression tree. /// </summary> /// <returns> /// An <see cref="T:System.Linq.IQueryable`1"/> that can evaluate the query represented by the specified expression tree. /// </returns> /// <param name="entry">The <see cref="EntryObject"/> to use as the root.</param> /// <param name="expression">An expression tree that represents a LINQ query.</param><typeparam name="TElement">The type of the elements of the <see cref="T:System.Linq.IQueryable`1"/> that is returned.</typeparam> public virtual IQueryable <TElement> CreateQuery <TElement>(EntryObject entry, Expression expression) { return(new EntryQuery <TElement>(new EntrySetCollectionQueryState(Context, _entry, _scope, typeof(TElement), expression))); }
/// <summary> /// /// </summary> /// <param name="entry"></param> /// <param name="scope"></param> /// <param name="context"></param> public EntrySetCollectionQueryProvider(EntryObject entry, SearchScope scope, DirectoryContext context) : base(context) { _entry = entry; _scope = scope; }
/// <summary> /// Initializes a new instance of the <see cref="EntryReference{TEntry}"/> class. /// </summary> /// <param name="entryObject">The entry object.</param> /// <param name="property">The property of the parent <see cref="EntryObject"/>.</param> public EntryReference(EntryObject entryObject, PropertyInfo property) { _entryObject = entryObject; _property = property; }