Hi,
I'd like to suggest adding a new delegate for validation rules that returns the result inside the eventargs, instead of returning a boolean value. So instead of this code:
Private Shared Function CheckABRule(Of T As MyBO)(ByVal target As T, ByVal e As Validation.RuleArgs) As Boolean
If target.PropertyA > target.PropertyB Then
e.Description = "A must be lower than B"
Return False
Else
Return True
End If
End Function
We would have this little more compact code:
Private Shared Sub CheckABRule(Of T As MyBO)(ByVal target As T, ByVal e As Validation.ResultRuleArgs)
e.Description = "A must be lower than B"
e.Result = Not (target.PropertyA > target.PropertyB)
End Sub
What do you think?
Regards