The ValidateHandler() method performs a check to ensure that the rule method is not an instance method of the business object type:
Private Function ValidateHandler(ByVal method As System.Reflection.MethodInfo) As Boolean
If Not method.IsStatic AndAlso method.DeclaringType.Equals(mTarget.GetType) Then
Throw New InvalidOperationException(String.Format("{0}: {1}", _ My.Resources.InvalidRuleMethodException, method.Name))
End If
Return True
End Function
Question:
What if you have split classes and the Base type has an instance method which is inherited by the final type? Will this code catch that? Should it?
Joe
Copyright (c) Marimer LLC