I'm using attribute-based validation, and I would like to limit what can be entered in theses attributes.
ex:
ThisValidatesSomethingAttribute(Type typeOfExceptionToThrowOnFailure)
so on use it is
[ThisValidatesSomething(typeof(MassiveFailureException))]
public int SomeIntParameter()
is there a way to limit the types that can be entered in this attribute?
I want to limit the Type parameter to be only types that derive from perhaps say a base class named "SuperSpecialBaseException"
In generics I would just use a type constraint "where T : SuperSpecialBaseException" but of course, this is not generics (joyful Attribute limitation)