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
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.
mou_inn
Participant
778 Points
953 Posts
Confusion regarding a linq query
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
Rion William...
All-Star
26624 Points
4414 Posts
Re: Confusion regarding a linq query
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.
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Confusion regarding a linq query
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:
[__DynamicallyInvokable] 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) { throw Error.ArgumentNull("outer"); } if (inner == null) { throw Error.ArgumentNull("inner"); } if (outerKeySelector == null) { throw Error.ArgumentNull("outerKeySelector"); } if (innerKeySelector == null) { throw Error.ArgumentNull("innerKeySelector"); } if (resultSelector == null) { throw Error.ArgumentNull("resultSelector"); } return JoinIterator<TOuter, TInner, TKey, TResult>(outer, inner, outerKeySelector, innerKeySelector, resultSelector, null); }