New Posts New Posts RSS Feed: DevForce approach for validation of non entities.
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

DevForce approach for validation of non entities.

 Post Reply Post Reply
Author
Sleepy Hollow Ranch View Drop Down
Newbie
Newbie
Avatar

Joined: 05-Oct-2011
Posts: 1
Post Options Post Options   Quote Sleepy Hollow Ranch Quote  Post ReplyReply Direct Link To This Post Topic: DevForce approach for validation of non entities.
    Posted: 05-Oct-2011 at 1:42pm
I would like to know what people are or should be using for validation of non-entities and what is the devforce way of doing this? I have not found documentation on this subject(I am assuming that there is no documentation at this point... I searched)
After researching for a bit I thought it best to see if there is a devforce way of doing this. Any help would be greatly appreciated.
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 06-Oct-2011 at 11:55am
Although not particularly well-documented, you can use DevForce to validate non-entities. 
 
With entities you get built-in validation, so with non-entities you have to drive the validation yourself.  In your property setter you can call VerifierEngine.ExecuteBeforeSet and/or ExecuteAfterSet for the property in question.  To perform instance-level validation you call VerifierEngine.Execute.  A VerifierEngine can be created standalone, or you can use your EntityManager's.  You can use standard DevForce validation attributes on non-entities, and also create custom verifiers.
 
Although we don't have a sample, we do make use of non-entity validation in the DevForce Silverlight Business Application template.  If you've used that, the VerifiableObject class defined there serves as the base class for non-entity classes requiring verification.  The VerifiableObject also implements INotifyPropertyChanged and INotifyDataErrorInfo.  You can see this code in action if you create a new solution from this template, or I can upload the class if you're interested.
 
For the record, our validation documentation is here - http://drc.ideablade.com/xwiki/bin/view/Documentation/validate
 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down