Class NCacheQuery<T>
Represents an IQueryable instance. Use this class to create a queryable object with the specified type T.
Inheritance
Inherited Members
Assembly: Alachisoft.NCache.Linq.dll
Syntax
public class NCacheQuery<T> : IQueryable<T>, IQueryable, IEnumerable<T>, IEnumerable
Type Parameters
Name | Description |
---|---|
T | The type of the queryable object. |
Constructors
NCacheQuery(ICache)
The constructor used to create a custom class LINQ object.
Declaration
public NCacheQuery(ICache cache)
Parameters
Type | Name | Description |
---|---|---|
ICache | cache | This is an instance of cache interface that contains services and methods used to perform operations on the cache. |
Examples
The following example creates a custom class LINQ object and performs a LINQ query to search the cache.
IQueryable <Product>= new NCacheQuery <Product> (cache);
var result = from prod in products
where prod.ProductID > 1001
select prod;
if (result != null)
{
foreach (Product product in result)
{
// Perform operations
}
}
Properties
ElementType
Gets the type of the element(s) returned when the expression tree associated with instance of System.Linq.IQueryable is executed.
Declaration
public Type ElementType { get; }
Property Value
Type | Description |
---|---|
System.Type | Gets the type of the element(s) returned when the expression tree associated with instance of System.Linq.IQueryable is executed. |
Implements
Expression
Gets the expression tree associated with the instance of System.Linq.IQueryable.
Declaration
public Expression Expression { get; }
Property Value
Type | Description |
---|---|
System.Linq.Expressions.Expression | Gets the expression tree associated with the instance of System.Linq.IQueryable. |
Implements
Provider
Gets the query provider associated with the instance of System.Linq.IQueryable.
Declaration
public IQueryProvider Provider { get; }
Property Value
Type | Description |
---|---|
System.Linq.IQueryProvider | Gets the query provider associated with the instance of System.Linq.IQueryable. |
Implements
Methods
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<T> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<T> | An enumerator that iterates through the collection. |
Implements
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator | An enumerator that iterates through the collection. |