Linq Queries. Brief

#1 Extension methods for linq operators should be lazy loading. This behaviour is achieved easily with the “yield” operator presented in C# 2.0

#2 ToList(), ToArray() are called greedy operators. They force a query to execute immediately

#3 Nested queries of Linq To Object are executed for each element in sequence. This makes a performance hint. Grab their results before an outter query and pass them into it if possible

#4 ThenBy and ThenByDescending extension methods for IOrdered* is used to perform a composite sorting

#5 System.Linq.Dynamic allows to build dynamic queries in runtime based on string parameters

#6 LINQ4Pad is a nice scratch linq tool

This entry was posted in .NET, LINQ. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s