Search Results: https://www.ecosia.org/search?q=linq+tricks&addon=opensearch
LINQ Tips and Tricks:https://markheath.net/post/linq-tips-and-tricks
Here is a quick overview:
- Use LINQPad
- Think in Patterns
- Use Pipelines
- Be Lazy
- Extend LINQ
- Optimize Performance
- Understand the Underlying SQL
Learn to Love LINQ:
https://gist.github.com/jehugaleahsa/9d92be18e642bc65d7a167c621d91e90
- Query vs Method syntax
- Use multiples wheres to break up long conditionals
- Use where anywhere
- Uniqueness on multiple keys
- Using into and let
- DefaultIfEmpty and left-joins
- Joins and alternatives
- Include always at the end
- Avoiding null tests
- Any() && !Skip(1).Any()
- UniqueOrDefault
- Enumerable.Repeat(x, 1) and Enumerable.Empty().DefaultIfEmpty(x)
- Building up an IEnumerable
50 LINQ Examples, Tips and How To’s
https://www.dotnetcurry.com/linq/727/linq-examples-tips-tricks
- List
.ConvertAll>>() with Lambda Expression - Calculate the Size of a Folder/Directory using .NET 4.0
- LINQ: Generate Odd Numbers using Parallel Execution
- LINQ: Compare two Sequences
- LINQ: Calculate Average File Size in C#
- LINQ: Generate a Cartesian Product
- LINQ: List Classes implementing the IEnumerable Interface
- Find Uppercase words in a String using C#
- LINQ: Query Comma Separated Value (CSV) files
- Generate Odd Numbers within a Range using LINQ
- Generate Sequence of Float Numbers within a Range using LINQ
- Query a Sequence using LINQ
- Divide Sequence into Groups and Query using LINQ
- LINQ – Left Join Example in C#
- Inner Join Example in LINQ and C#
- Using from-let-where Clause in LINQ
- List all .NET Attributes in the Loaded Assemblies
- Rewrite Nested ForEach Loop in LINQ
- Count File Extensions and Group it using LINQ
- Swap Words inside a String using LINQ
- Filter a Type in .NET inside the For-Each Loop
- Split a String Collection into Groups using LINQ
- Highest Value in each Group using LINQ
- Loop through Master-Detail Records using LINQ
- Concatenate Unique Elements of two List<String> and Sort using LINQ
- List all Files in .NET 4.0 Based on the Creation Date
- Skip and Select Elements in a String Array using LINQ
- Enumerate Hidden Directories in .NET 4.0
- Ordering Elements of a List
by Length and Content - Distinct OrderBy in LINQ
- Using LINQ to select Only Strings from an ArrayList
- Combine Multiple Sequences in LINQ using the Zip Operator
- Sort a String Array containing Numbers using LINQ
- Join Two String Arrays with Distinct values using LINQ
- Using TrueForAll with Generic Lists
- Determine all Types that Implement an Interface
- Using LINQ to Find Top 5 Processes that are Consuming Memory
- Find Distinct Text Using LINQ
- Using LINQ to Search and Delete Old Files
- Using LINQ to Find the Sum of a MultiDimensional Array
- Get Unique Selected Items From Multiple ASP.NET ListBox and Merge them using LINQ
- How to Sort Data using LINQ
- Retrieve Selected Items of an ASP.NET ListBox using LINQ
- Replicating the ‘IN’ operator in LINQ
- Implementing Paging in a Generic List using LINQ
- LINQ to XML
- LINQ to XML Sorting
- Serialize XDocument in LINQ To XML
- Select Last N elements using LINQ to XML
- Create a XML Tree from a String