Category: Linq

A scenario where LINQ is too dynamic (answered)

The situation I talked about in my previous post had one very big issue: LINQ sometimes just is too dynamic… 😉The fact that I changed the value for the Ranking property for each SpecificObject that got matched, made the primary LINQ query have a different outcome. LINQ uses lazy evaluation and  because of that, the …

Read More “A scenario where LINQ is too dynamic (answered)”

A scenario where LINQ is too dynamic

While developing an algorithm to match preferences to possibilities, I had to sort a generic list of a specific object type (SpecificObject). The first x objects would be matched, the rest would be excluded because of the number of available places. To determine the group of objects that would be matched and the group that …

Read More “A scenario where LINQ is too dynamic”

Selecting all the controls of a specific type, the (built in!) LINQ way

We probably all worked with dynamically generated controls on forms, ASP.NET pages or (user) controls. And I guess we’ve all written for-each statements to loop through the ControlCollection and filter out all the controls of a specific type, right? I wanted to do the same today, so I started by trying to use LINQ for …

Read More “Selecting all the controls of a specific type, the (built in!) LINQ way”