Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
IntersectBy<TSource,TKey>(IQueryable<TSource>, IEnumerable<TKey>, Expression<Func<TSource,TKey>>) |
Produces the set intersection of two sequences according to a specified key selector function. |
IntersectBy<TSource,TKey>(IQueryable<TSource>, IEnumerable<TKey>, Expression<Func<TSource,TKey>>, IEqualityComparer<TKey>) |
Produces the set intersection of two sequences according to a specified key selector function. |
Produces the set intersection of two sequences according to a specified key selector function.
public:
generic <typename TSource, typename TKey>
[System::Runtime::CompilerServices::Extension]
static System::Linq::IQueryable<TSource> ^ IntersectBy(System::Linq::IQueryable<TSource> ^ source1, System::Collections::Generic::IEnumerable<TKey> ^ source2, System::Linq::Expressions::Expression<Func<TSource, TKey> ^> ^ keySelector);
public static System.Linq.IQueryable<TSource> IntersectBy<TSource,TKey>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TKey> source2, System.Linq.Expressions.Expression<Func<TSource,TKey>> keySelector);
static member IntersectBy : System.Linq.IQueryable<'Source> * seq<'Key> * System.Linq.Expressions.Expression<Func<'Source, 'Key>> -> System.Linq.IQueryable<'Source>
<Extension()>
Public Function IntersectBy(Of TSource, TKey) (source1 As IQueryable(Of TSource), source2 As IEnumerable(Of TKey), keySelector As Expression(Of Func(Of TSource, TKey))) As IQueryable(Of TSource)
The type of the elements of the input sequences.
The type of key to identify elements by.
An IQueryable<T> whose distinct elements that also appear in source2
will be returned.
An IEnumerable<T> whose distinct elements that also appear in the first sequence will be returned.
A function to extract the key for each element.
A sequence that contains the elements that form the set intersection of two sequences.
source1
or source2
is null
.
Product | Versions |
---|---|
.NET | 6, 7, 8, 9, 10 |
Produces the set intersection of two sequences according to a specified key selector function.
public:
generic <typename TSource, typename TKey>
[System::Runtime::CompilerServices::Extension]
static System::Linq::IQueryable<TSource> ^ IntersectBy(System::Linq::IQueryable<TSource> ^ source1, System::Collections::Generic::IEnumerable<TKey> ^ source2, System::Linq::Expressions::Expression<Func<TSource, TKey> ^> ^ keySelector, System::Collections::Generic::IEqualityComparer<TKey> ^ comparer);
public static System.Linq.IQueryable<TSource> IntersectBy<TSource,TKey>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TKey> source2, System.Linq.Expressions.Expression<Func<TSource,TKey>> keySelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer);
static member IntersectBy : System.Linq.IQueryable<'Source> * seq<'Key> * System.Linq.Expressions.Expression<Func<'Source, 'Key>> * System.Collections.Generic.IEqualityComparer<'Key> -> System.Linq.IQueryable<'Source>
<Extension()>
Public Function IntersectBy(Of TSource, TKey) (source1 As IQueryable(Of TSource), source2 As IEnumerable(Of TKey), keySelector As Expression(Of Func(Of TSource, TKey)), comparer As IEqualityComparer(Of TKey)) As IQueryable(Of TSource)
The type of the elements of the input sequences.
The type of key to identify elements by.
An IQueryable<T> whose distinct elements that also appear in source2
will be returned.
An IEnumerable<T> whose distinct elements that also appear in the first sequence will be returned.
A function to extract the key for each element.
An IEqualityComparer<T> to compare keys.
A sequence that contains the elements that form the set intersection of two sequences.
source1
or source2
is null
.
Product | Versions |
---|---|
.NET | 6, 7, 8, 9, 10 |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in