bartoszlenar / Validot

Validot is a performance-first, compact library for advanced model validation. Using a simple declarative fluent interface, it efficiently handles classes, structs, nested members, collections, nullables, plus any relation or combination of them. It also supports translations, custom logic extensions with tests, and DI containers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WithFailFastStrategy - fail fast, but only in the related scope

bartoszlenar opened this issue · comments

Feature description

  • Ability to set the fail-fast strategy in a single scope.

Feature in action

Specification<Model> specification = s => s
    .Member(m => m.Member, memberSpecification).WithFailFastStrategy();
Specification<Model> specification = s => s
    .AsModel(anotherSpecification).WithFailFastStrategy();

Feature details

  • New parameter command: WithFailFastStrategy.
  • The related scope command would terminate and return error output immediately after detecting a single error.
  • Internally it looks like temporary setting FailFast to true in the ValidationContext class, but let's investigate that further.