Nicholas,
I know of a GuidRequired function in ActiveObjects (ActiveObjects\Rules\ActiveRules.vb) :
Public Shared Function GuidRequired(ByVal target As Object, ByVal e As RuleArgs) As Boolean
Dim TestGuid As Guid = New Guid(GetPropertyValue(target, e.PropertyName).ToString)
If TestGuid.Equals(Guid.Empty) Then
e.Description = String.Format("{0} required", e.PropertyName)
Return False
Else
Return True
End If
End Function
There are some more 'standard' validations for int-range and dates also, check 'm out in the ActiveObjects download on Petar's ActiveObjects site : http://csla.kozul.info/
Hope this helps.
Jurjen.
Sort of. <g>
I created my own class of "common rules" and put it in the same folder as my subclasses of CSLA that all my BOs derive from. I basically copied Rocky's common rules, put them in my own namespace to avoid conflicts, and then enhanced it. This gives ne a single place to put all of mycommon rules. Plus I now have the ability to add things like Property descriptions to my rules so that the broken rule reads: "Account Code is invalid" instead of "Acctcd is invalid".
Plus any suggestions which are made to enhance Rocky's rules can be applied to my rules rigt away without having to wait for the next version of CSLA.
Finally, any new rules you may want to write (like GUID required) can be put in this one place and used for multiple BOs.
Joe
Copyright (c) Marimer LLC