Category Archives: C#

Validating with Lambda Expressions

I’ve recently been working on a small library for doing validation with lambda expressions. It allows you to run a set of validators against an object, then collects the validation errors in a list. Here are some examples:

var person = new Person();
 
var validator = Validator.For(person).Rules(
rule => rule.For(p => p.Forename).NotNull(), //Forename cannot be null
rule => rule.For(p [...]

Rails-like features in C# 3

I recently purchased a copy of Agile Web Development with Rails in an attempt to learn more about Ruby on Rails. I’ve been slowly working through the sample application and so far working with Rails has been a very pleasant experience.
One of the thing I really like about RoR is the very readable method names. [...]