Validating business logic in C# with specification pattern

Henrique Dal Bello
May 13 · 2 min read

Let he who hasn’t got lost in dozens of business logic of a project cast the first stone!


Let’s start coding!

Consider the entity Person:


Ok, we got it.. But let’s go further!

As a bonus section, I would like to refactor our specifications. It’s bad to see many of them just to do a string.IsNullOrWhiteSpace(), isn’t it?

Generics and lambda expressions are awesome!

Training Center

Conectamos pessoas que querem aprender algo relacionado a desenvolvimento de software com gente que pode guiá-las.

Henrique Dal Bello

Written by

Knowledge is for sharing. Developing bugs since 2012 💻

Training Center

Conectamos pessoas que querem aprender algo relacionado a desenvolvimento de software com gente que pode guiá-las.