Click or drag to resize
QueryableExShareTSource, TResult Method (IQueryableTSource, ExpressionFuncIEnumerableTSource, IEnumerableTResult)
Shares the source sequence within a selector function where each enumerator can fetch the next element from the source sequence.

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

Parameters

source
Type: System.LinqIQueryableTSource
Source sequence.
selector
Type: System.Linq.ExpressionsExpressionFuncIEnumerableTSource, IEnumerableTResult
Selector function with shared access to the source sequence for each enumerator.

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 shared 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