Vogen icon indicating copy to clipboard operation
Vogen copied to clipboard

Fluent builder

Open SteveDunn opened this issue 1 year ago • 1 comments

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());

SteveDunn avatar Sep 30 '24 05:09 SteveDunn

Very much dislike this style personally.

xamir82 avatar Oct 01 '24 17:10 xamir82

Thanks for the feedback. Looking at it again after a couple of months, it doesn't look as appealing as it did initially.

SteveDunn avatar Nov 01 '24 07:11 SteveDunn