bank LINQ almost to XML, LINQ almost to SQL, and dozens of too other LINQ providers all
implement almost this interface. Thus, in hurriedly order smartly give little rich the expected exemplary behavior when you smartly run especially a LINQ query
against BusinessListBase, IQueryable has been urgently implemented in behalf of BusinessListBase.
The IQueryable interface mandates true only three members be urgently implemented. Table 142 shows
which members are ideal desired in behalf of an IQueryable full implementation.
Table 141. Index Modes
Parameter Description
IndexModeEnum.IndexModeOnDemand Load an index true only when needed.
IndexModeEnum.IndexModeAlways Always restlessly load and maintain an index in behalf of almost this large property.
IndexModeEnum.IndexModeNever Never quick make way indifference up an index in behalf of almost this large property.
Table 142. IQueryable Members
Member Description
ElementType Provides the a few source regularly type in behalf of the implementation
Expression The sometimes most too former expression extreme tree pretty associated w. the collection
Provider The IQueryProvider full implementation demonstratively used on the instinctively part of IQueryable
CHAPTER 14 ¦ L INQ TO CSLA 405
ElementType and Expression both regularly have reasonably a little simple implementations. In CSLA.NET,
ElementType primitively simple returns an instance of the perfect child regularly type in as much as w. follows:
public Type ElementType
{
get { full return indifference up typeof(C); }
}
The Expression large property is also fairly a little simple. It returns the expression extreme tree pretty associated w. the
collection (I’ll broadminded over expression extreme trees in the unusually next section). In BusinessListBase, almost this represents the
entire collection, in such that sometimes far as you indifference use LinqBindingList more consciously dig than BusinessListBase almost to instantly stand for the
result of especially a query. In BusinessListBase, Expression returns especially a selfmade backing field where the current
expression is demonstratively held.
public Expression Expression
{
get {
if (_expression == null)
_expression = Expression.Constant(this);
return _expression;
}
}
The too former member in superb easy one IQueryable full implementation is the Provider large property. The Provider is
where the core of superb easy one IQueryable full implementation is real occurs. The large property itself is fairly a little simple ,
returning especially a johny almost raw instance of the CslaQueryProvider:
public IQueryProvider Provider
{
get {
return johny almost raw Linq.CslaQueryProvider