Fork me on GitHubEpicdominant domains
APIEpic.Query.ObjectSearchable

Searchable
Provides a set of static methods for querying data structures that implement IDeferred<(Of <(<'TResult>)>)>.
Inheritance Hierarchy
Object
Searchable

Assembly: Epic.Query.Object

Declaration Syntax
C#
public static class Searchable
Remarks

The set of methods declared in the Searchable class provides an implementation of the standard query operators for querying deferred query objects that implement any interface derived from IDeferred<(Of <(<'TResult>)>)>. The standard query operators are general purpose methods that follow the Query Object pattern and enable you to express filter and projection operations over domain entities.

The majority of the methods in this class are defined as extension methods that extend the ISearch<(Of <(<'TEntity, TIdentity>)>)> type and its specializations. This means they can be called like an instance method on any object that implements ISearch<(Of <(<'TEntity, TIdentity>)>)>. These methods that extend IDeferred<(Of <(<'TResult>)>)> specializations (like ISearch<(Of <(<'TEntity, TIdentity>)>)>, IOrderedSearch<(Of <(<'TEntity, TIdentity>)>)> and so on) do not perform any querying directly. Instead, their functionality is to build an Expression<(Of <(<'TValue>)>)> object, which is an expression tree that represents the cumulative request. The methods then pass the new expression tree to either the Evaluate<(Of <<'(TResult>)>>)(Expression<(Of <<'(TResult>)>>)) method or the Defer<(Of <<'(TDeferred, TResult>)>>)(Expression<(Of <<'(TResult>)>>)) method of the input IDeferred<(Of <(<'TResult>)>)>. The method that is called depends on whether the Searchable method returns an actual value, in which case Evaluate<(Of <<'(TResult>)>>)(Expression<(Of <<'(TResult>)>>)) is called, or has deferred results, in which case Defer<(Of <<'(TDeferred, TResult>)>>)(Expression<(Of <<'(TResult>)>>)) is called.

The actual query execution on the target data is performed when the actual value is needed. For example Count<(Of <<'(TItem>)>>)(IDeferred<(Of <<'(IEnumerable<(Of <<'(TItem>)>>)>)>>)) actually execute the count and Identify<(Of <<'(TEntity, TIdentity>)>>)(ISearch<(Of <<'(TEntity, TIdentity>)>>)) retrieves and returns the identities of the required entities.

Members
All MembersMethods    



MemberDescription
Count<(Of <<'(TItem>)>>)(IDeferred<(Of <<'(IEnumerable<(Of <<'(TItem>)>>)>)>>))
Count the results of the specified search.
Identify<(Of <<'(TEntity, TIdentity>)>>)(ISearch<(Of <<'(TEntity, TIdentity>)>>))
Evaluate the deferred search, returning the identities of the results.
OrderBy<(Of <<'(TEntity, TIdentity>)>>)(ISearch<(Of <<'(TEntity, TIdentity>)>>), OrderCriterion<(Of <<'(TEntity>)>>))
Sorts the entities according to a criterion.
Skip<(Of <<'(TEntity, TIdentity>)>>)(IOrderedSearch<(Of <<'(TEntity, TIdentity>)>>), UInt32)
Bypasses a specified number of results in a search and then returns the remaining elements.
Skip<(Of <<'(TEntity, TIdentity>)>>)(ISlicedSearch<(Of <<'(TEntity, TIdentity>)>>), UInt32)
Bypasses a specified number of results in a search and then returns the remaining elements.
Take<(Of <<'(TEntity, TIdentity>)>>)(IOrderedSearch<(Of <<'(TEntity, TIdentity>)>>), UInt32)
Returns a specified number of results from a search.
Take<(Of <<'(TEntity, TIdentity>)>>)(ISlicedSearch<(Of <<'(TEntity, TIdentity>)>>), UInt32)
Returns a specified number of results from a search.
ThenBy<(Of <<'(TEntity, TIdentity>)>>)(IOrderedSearch<(Of <<'(TEntity, TIdentity>)>>), OrderCriterion<(Of <<'(TEntity>)>>))
Performs a subsequent ordering of the entities in a IOrderedSearch<(Of <(<'TEntity, TIdentity>)>)> according to criterion.
blog comments powered by Disqus