LINQ method to see if two lists contain a match

This post gives you the code to check if two lists contain a match. It is written in C# and uses LINQ.

Read More

Write, test and share .NET code in your browser with dotnetfiddle

I recently found this free online tool called dotnetfiddle. It was inspired by jsfiddle. It allows you to write, test and share .NET code in your browser.

Read More


I recently came across this fantastic resource. It is called LINQPad. You can use it to test any C#, F# or VB snippet or program. You can even use it to query databases in LINQ or SQL. It's ideal if you find some code on the internet that you want to quickly…

Read More

Get a flat list of exception and inner exception error messages

Debugging errors can be difficult, especially when you need to see the errors inside the errors. This post shows you how you can get all errors as a collection of errors rather than them being hidden inside other errors. You can create an extension method like…

Read More

Sorting a list into random order using linq

Every now and again, there is a need to produce a list in a random order. I've found a very reliable way to do this using linq and the Guid class. It might sound complicated, but when you see the example, it should make sense and you should see how simple i…

Read More

List ForEach Method

You may or may not be aware of the .ForEach() Method which is available on List objects. It is very handy for shortening your code. Lets say you want to write a method which returns a list of MailAdress objects. A more traditional way would be to do the…

Read More