Skip to content

Instantly share code, notes, and snippets.

@wullemsb
Created December 10, 2018 07:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wullemsb/05f59cf01a29fbea552a59ff04db6c96 to your computer and use it in GitHub Desktop.
Save wullemsb/05f59cf01a29fbea552a59ff04db6c96 to your computer and use it in GitHub Desktop.
RuleFor(x => x.FastDelivery)
.NotEmpty()
.WithState(x => new ValidationState() {
Code = "FastDelivery.empty",
Keys = { ValidationKeys.Delivery }
});
RuleFor(x => x.DeliveryDate)
.NotEmpty()
.WithState(x => new ValidationState()
{
Code = "DeliveryDate.empty",
Keys = { ValidationKeys.Delivery }
})
.When(x=> x.FastDelivery == true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment