Click or drag to resize
QueryableExMemoizeTSource, TResult Method (IQueryableTSource, Int32, ExpressionFuncIEnumerableTSource, IEnumerableTResult)
Memoizes the source sequence within a selector function where a specified number of enumerators can get access to all of the sequence's elements without causing multiple enumerations over the source.

Namespace: System.Linq
Assembly: System.Interactive.Providers (in System.Interactive.Providers.dll) Version: 1.2.0.0
Syntax
C#
public static IQueryable<TResult> Memoize<TSource, TResult>(
	this IQueryable<TSource> source,
	int readerCount,
	Expression<Func<IEnumerable<TSource>, IEnumerable<TResult>>> selector
)

Parameters

source
Type: System.LinqIQueryableTSource
Source sequence.
readerCount
Type: SystemInt32
Number of enumerators that can access the underlying buffer. Once every enumerator has obtained an element from the buffer, the element is removed from the buffer.
selector
Type: System.Linq.ExpressionsExpressionFuncIEnumerableTSource, IEnumerableTResult
Selector function with memoized access to the source sequence for a specified number of enumerators.

Type Parameters

TSource
Source sequence element type.
TResult
Result sequence element type.

Return Value

Type: IQueryableTResult
Sequence resulting from applying the selector function to the memoized view over the source sequence.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IQueryableTSource. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also