Vogen
Vogen copied to clipboard
Fluent builder
Describe the feature
I noticed this nice feature from a similar value object library named 'Typely'.
public class TypesSpecification : ITypelySpecification
{
public void Create(ITypelyBuilder builder)
{
builder.OfInt().For("ContactId").GreaterThan(0);
builder.OfString()
.For("InsuranceCode")
.NotEmpty()
.Length(10)
.Must(x => x.StartsWith("A91"))
.Normalize(x => x.ToUpper());
Very much dislike this style personally.
Thanks for the feedback. Looking at it again after a couple of months, it doesn't look as appealing as it did initially.