Tag Archives: Language Integrated Query

LINQ – the order of elements when using Where()

Last week I was asked if the order of elements found using a where clause was guaranteed to be the same as the order of the original collection. That question is hard to answer. In the normal case (where nobody has overwritten … Continue reading

Posted in C#, Linq | Tagged , , , , , , | Leave a comment

LINQ and iterating over null collections.

Ok, todays title is weird, but I have come up with a little hack, that will make the code easier to read (sometimes). At work we have some pretty clear specifications, that says how to fill out some properties in … Continue reading

Posted in C#, Linq | Tagged , , , , | Leave a comment

LINQ and counting

When we work with collections we often have to count the elements in some way. Sometimes we need to know how many elements there are or how many elements that  complies with some  condition. So let’s assume that I have … Continue reading

Posted in C#, Linq | Tagged , , , , , | 2 Comments