Tag Archives: LINQ

Getting random List Items using LINQ

Today while writing test cases, I come to scenario, where I need to take random values from my generic list, and here is the snippet, which will randomly select (not exactly select, it is ordering) Happy coding

Posted in .Net, .Net 4.0, ASP.Net | Tagged , , , , | Leave a comment

How find all the types implemented by an interface

Here is code snippet which helps to find all the types from an assembly, which is implemented from a specific interface. And here is the same which is implemented by lambda expressions. Happy Coding

Posted in .Net, .Net 3.0 / 3.5, .Net 4.0, ASP.Net | Tagged , , , , , | Leave a comment

Update multiple elements at once using LINQ

Few days back one of my friend asked Is there any option available to update property of an collection objects using Linq. I couldn’t find a method that day, but yesterday again I come across the same problem. So I … Continue reading

Posted in .Net, .Net 3.0 / 3.5, .Net 4.0, Windows Forms | Tagged , , , , , | Leave a comment

Selecting controls using LINQ

One of my colleague asked how to get all the text boxes with no text entered in Windows form without using a For Loop. I thought of writing it with LINQ. And here is my implementation. But this will generate … Continue reading

Posted in .Net, Windows Forms | Tagged , , , , | Leave a comment

Sorting collections using LINQ

We can sort collections using Linq using OrderBy and OrderByDescending Clause, these extention methods helps to sort collections in Ascending and Descending modes respectively. For ASCENDING mode. And for DESCENDING mode Happy Coding

Posted in .Net, .Net 3.0 / 3.5 | Tagged , , | Leave a comment