EnumerableExPublishTSource, TResult Method (IEnumerableTSource, FuncIEnumerableTSource, IEnumerableTResult) |
Publishes the source sequence within a selector function where each enumerator can obtain a view over a tail of the source sequence.
Namespace: System.LinqAssembly: System.Interactive (in System.Interactive.dll) Version: 1.2.0.0
Syntaxpublic static IEnumerable<TResult> Publish<TSource, TResult>(
this IEnumerable<TSource> source,
Func<IEnumerable<TSource>, IEnumerable<TResult>> selector
)
Parameters
- source
- Type: System.Collections.GenericIEnumerableTSource
Source sequence. - selector
- Type: SystemFuncIEnumerableTSource, IEnumerableTResult
Selector function with published access to the source sequence for each enumerator.
Type Parameters
- TSource
- Source sequence element type.
- TResult
- Result sequence element type.
Return Value
Type:
IEnumerableTResultSequence resulting from applying the selector function to the published 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
IEnumerableTSource. 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