Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 18, 2013 12:56 AM by Decker Dong - MSFT
Jan 16, 2013 05:15 PM|LINK
i never use LINQ because i do not know linq. i am learning linq. i saw a linq query and just do not understand the meaning. so please anyone explain and help me to understand this query.
i just do not understand this part like "into t" what is going to be dumped into t. so please discuss this in more details with more similar kind of linq statement as a result i can understand it. thanks
Jan 16, 2013 05:22 PM|LINK
If you are having any concerns about the into keyword, the following thread on Stack Overflow might help you out :
LINQ "into" Keyword Confusion
Basically when you perform a JOIN operation (like the one being performed within your statement)
the INTO statement takes all of the contents of the JOIN operation and stores it into a specific variable (in this case t)
which can be used within other areas of the same call to define scope.
MSDN has a very comprehensive set of documentation on using LINQ and LINQ queries, which you can find
here. Another popular resource is the 101 LINQ Samples project, which
contains descriptions, code and breakdowns of over 100 different calls and types of calls within LINQ.
Jan 18, 2013 12:56 AM|LINK
Join in LINQ will:
1) Fetch the join key as a "Groupped Key".
2) Fetch all the related (foreign records) whose foreign key the same value as your joint key together.
3) The final result will be IEnumerable<T>.
Here's the reflected codes:
public static IEnumerable<TResult> Join<TOuter, TInner, TKey, TResult>(this IEnumerable<TOuter> outer, IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter, TInner, TResult> resultSelector)
if (outer == null)
if (inner == null)
if (outerKeySelector == null)
if (innerKeySelector == null)
if (resultSelector == null)
return JoinIterator<TOuter, TInner, TKey, TResult>(outer, inner, outerKeySelector, innerKeySelector, resultSelector, null);