jwaliszko / ExpressiveAnnotations

Annotation-based conditional validation library.
MIT License
351 stars 124 forks source link

Requiered if a value is given... #184

Closed ghost closed 6 years ago

ghost commented 6 years ago

How to use like this..

[RequiredIf("ORG_BY_CD", "5", ErrorMessage = "Coordinator ID is required")] // This means: IF 'ORG_BY_CD' is equal 5 (for the example) > make 'COR_CI_ID_NUM' required and apply its all validation / data annotations public string COR_CI_ID_NUM { get; set; }

thaks...

jwaliszko commented 6 years ago

Please refer to the docummentation, the most straightforward cases are covered there.