Validating biz object property without using attribute

Topics: Validation Application Block
Feb 20, 2008 at 2:57 AM
Imagine a scenario where i don't have access to source code of the biz object but at the same time i want to validate the properties of biz object. How can I achieve this as I cannot use validation attribute such as StringLengthValidator available in validation application block on the property?

Basically, i want to validate the property without using attribute but with the validators available in validation application block.

Please help me!

Mar 7, 2008 at 9:55 PM
You should use validation by configuration. Use the config tool that ships with the enterprise library to configure your validation rules.

Add a validation section. Add the types to be validated using by choosing the appropriate .NET assembly and you are good to go. You now have access to all built in validators.