You can't select a generic type using the configuration tool. You can edit the config manually though. Example:
However, supplying this as the type attribute for a type to validate won't be that helpful because for configuration, validators are created based on the actual type. To explain it better, supposing you instantiate a class that inherits from the
Dim list As BusinessObjectListBase(Of Topic)
list = New TopicList(Of Topic)
If you're using versions prior to 5.0, if you're validating the list variable, it will be validated against validation rules defined for BusinesObjectListBase(Of Topic) type which you don't have since you only have validation rule defined for BusinessObjectListBase(Of
T). Thus, in this case, you would need to define validation rules for every possible BusinessObjectListBase. On the other hand, if you're using version 5.0, the list variable will be validated against validation rules defined for TopicList(Of Topic)
(this is one of the changes made in VAB in EntLib 5.0). The workaround for both is to define the validators using attributes.
You can have the collection validate each item in the list by decorating the class with the ObjectCollectionValidator attribute. However, I'm not sure what do you mean when you say self-validate. Do you want something like when you add an item
to the collection, it will automatically detect whether that item is valid or invalid? If that's the case, you may use policy injection or unity to intercept the Add method. If you need further details on this, just let me know. It would
also help if you indicate what version you are using.
Global Technology and Solutions