-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to have conditional rules in contracts #6
Comments
I agree! A conditional validation is extremely useful! |
mstrYoda
added a commit
to mstrYoda/flunt
that referenced
this issue
Aug 30, 2018
…ract Desired example use case in issue: Contract.Required().IfNotNull(x.LastName, contract => contract.MinLength(3)); Implemented feature : _dummy = new Dummy(); _dummy.stringProp = "abc"; var wrong = new Contract() .Requires() .IfNotNull(_dummy.stringProp, x => x.IsDigit(_dummy.stringProp, nameof(_dummy.stringProp), "Property should be digit if not null"));
andrebaltieri
added a commit
that referenced
this issue
Apr 2, 2019
Issue #6 Added Ability To Have Conditional Rules In Contract
Moved to version 2! Check milestones! |
andrebaltieri
modified the milestones:
Flunt Release Q1 - 2021,
Flunt Release Q2 - 2021
Feb 13, 2021
This feature is a must have! |
Is there any prediction for this feature to be available? |
Sure @filipimosquini... there's a new version comming soon! |
I looked in the code and not find this feature. Is it removed? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example:
Contract .Required() .IfNotNull(x.LastName, contract => contract.MinLength(3));
Means: LastName is not required, but if informed, must have more 3 letters or more.
The text was updated successfully, but these errors were encountered: