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]
by Alex Siepman
16. May 2014 20:22
An extension method that makes paging in Linq to objects easy and efficient.
[More]
by Alex Siepman
17. March 2014 20:50
Lazy
Has some disadvantages when you use it for caching properties, If you use other members of a class, it has to be set in the constructor. I created an anternative so you can implement the property in the property. Also caching IEnumerable makes no sence because you get a new iterator all the time so in fact it is not cached at all. This is also fixed, [More]
by Alex Siepman
15. February 2014 17:26
Most IoC Containers uses reflection for inversion of control. This makes it hard to debug and the compiler can not check the creation at compile time. That is why I ceated to class that makes it possible to tell the container how to create a new object by providing it a Func (lambda). This makes debugging much easier when it doesn't works as you expected.
[More]
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]
by Alex Siepman
5. January 2014 09:33
When business objects needs to be stored in the database, they need to be validated. Creating a validation class make it easy to maintain en unit test the validations. Also implications are made easier.
[More]
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]
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]
by Alex Siepman
30. July 2013 16:28
An easy way to ceate a tree and query the nodes of the tree.
[More]
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]
by Alex Siepman
14. April 2012 10:30
Convert an enum to a enum-string dictionary with text including spaces.
[More]