Add context to IEnumerable<> elements

by Alex Siepman 9. February 2015 20:13
The WithContext extesnion method adds context to an IEnumerable Sequence like previous and next element but also the index in the sequence and even more: IsFirst, IsLast, Preceding, Following, Other etc. [More]

Random password generator with numbers and special characters

by Alex Siepman 31. May 2014 14:06
Random password generator with lowercase, uppercase, numbers and special characters. Each catagory can have a minimum number of characters. The minimum and maximum of the total length of the password is also a parameter of the method. Flexible enough for 99,9% of all situations. [More]

Paging with Linq to objects

by Alex Siepman 16. May 2014 20:22
An extension method that makes paging in Linq to objects easy and efficient. [More]

Permutations and missing values, helpful with unit testing

by Alex Siepman 13. January 2014 15:41
Creating of unit tests of al varations of 1 bool parameter usualy need 2 unit tests (false and true). But how do you create a parameter of type IEumerable. So many combinations are possible. A variant of the Permutations() method will help you to create almost all necessary combinations with just one extension method! [More]

LazyList<T>: A better LINQ-result-cache than List<T>

by Alex Siepman 9. October 2013 20:17
Caching LINQ results with ToList() has some disadvantages. Not using caching can have disadvantages to. There is a smart solution that does not cache more than needed. [More]

Except, intersect and union without distinct

by Alex Siepman 19. August 2013 19:22
Except, Intersect and Union are doing a distict as thy are a set operation. This blog will help you if you don't want a distict. [More]

A generic tree of nodes, the easy way!

by Alex Siepman 30. July 2013 16:28
An easy way to ceate a tree and query the nodes of the tree. [More]

Mapping without the switch command

by Alex Siepman 21. July 2013 16:57
If you need to map codes or values, don't use the switch statement. An extension method makes it much easier. [More]

Any, Single, Multiple and Count

by Alex Siepman 26. May 2012 17:20
.Any() is much more effecient than .Count() > 0. Other methods like .IsSingle() or .IsMultiple() are also much more efficient than .Count() == 1 or .Count() > 1. [More]

About the author

I am a software architect at Roxit and also a C# Developer. My main interests in the area of ​​C# are LINQ and generics

Visit my personal homepage (Dutch) for more info about me.

Month List

Page List