Queryable::Zip<TFirst, TSecond, TResult> Method
Merges two sequences by using the specified predicate function.
Assemblies: System.Linq.Queryable (in System.Linq.Queryable.dll)
System.Core (in System.Core.dll)
[ExtensionAttribute] public: generic<typename TFirst, typename TSecond, typename TResult> static IQueryable<TResult>^ Zip( IQueryable<TFirst>^ source1, IEnumerable<TSecond>^ source2, Expression<Func<TFirst, TSecond, TResult>^>^ resultSelector )
The type of the elements of the first input sequence.
The type of the elements of the second input sequence.
The type of the elements of the result sequence.
- Type: System.Linq::IQueryable<>
The first sequence to merge.
- Type: System.Collections.Generic::IEnumerable<>
The second sequence to merge.
Return ValueType: System.Linq::IQueryable<>
An IQueryable<T> that contains merged elements of two input sequences.
Usage NoteIn Visual Basic and C#, you can call this method as an instance method on any object of type IQueryable<>. 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).
The method generates a MethodCallExpression that represents calling itself as a constructed generic method. It then passes the MethodCallExpression to the CreateQuery<TElement>(Expression) method of the IQueryProvider represented by the Provider property of the source1 parameter.
The method merges each element of the first sequence with an element that has the same index in the second sequence. If the sequences do not have the same number of elements, the method merges sequences until it reaches the end of one of them. For example, if one sequence has three elements and the other one has four, the resulting sequence will have only three elements.
.NET FrameworkSupported in: 4.6, 4.5, 4
.NET Framework Client ProfileSupported in: 4
Portable Class LibrarySupported in: Portable Class Library
.NET for Windows Store appsSupported in: Windows 8
Supported in: Windows Phone 8.1
Supported in: Windows Phone Silverlight 8.1
Supported in: Windows Phone Silverlight 8
Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.