I friend linked me to this the other day and it changed how I program. It's not very often that one article changes the way I handle coding but this allowed me to clean up a lot of code. From the work in the article I have added one more function as well.
publicstatic TResult Let(this TInput o, Func evaluator, TResult failValue)
where TResult : classwhere TInput : class
if (o == null) return failValue;
This one allows for the calling of functions that return a value.