Validate property based on another property

Topics: Validation Application Block
May 1, 2009 at 1:35 PM
I have a class that has the following properties

bool HasFacility
int NoTimes

What I need to do is validate NoTimes baised on the value of HasFacility

If HasFacility is False then NoTimes must be 0
If HasFacility is True then NoTimes must be greater than 0

Any idea how I can achive this?

Cheers
May 4, 2009 at 2:13 AM
Refer to this FAQ item - http://entlib.codeplex.com/Wiki/View.aspx?title=How%20do%20I%20implement%20a%20conditional%20validation%3f&referringTitle=Home


Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com