ToLookup
2 posts2 contributors
+ FollowBe the first to follow this
Write about itArticles about ToLookup

How To Use Grouping Data Operations With Database Using LINQ
In this article, I will demonstrate how we can use GroupBy and ToLookup operator of Language-Integrated Query (LINQ). GroupBy and ToLookup operators are part of grouping data in Language-Integrated Query (LINQ). Grouping refers to the operation of putting data into groups so that the elements in each group share a common attribute. GroupBy & ToLookup return a collection that has a key and an inner collection based on a key field value. The execution of GroupBy is deferred whereas that of ToLookup is immediate. A LINQ query syntax can be end with the GroupBy or Select clause.

ToLookup Extension Method explained
The ToLookup() method can be used to quickly create lookup items based on different conditions.



