Using ValidEntity()

Posts   
 
    
Anthony
User
Posts: 155
Joined: 04-Oct-2006
# Posted on: 22-Mar-2010 12:05:31   

winforms,llblgen v2.6,adpter mode,vb.net

Trying to grasp how to use the validator method.

I have a winform with some controls bound to an entity through the BindingSource control.

Q..how do i validate the entity? AN example would be great!

As i have read i have added the Errorprovider to the form.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 22-Mar-2010 16:43:10   

AN example would be great!

Please check the Validation Example project posted in the Download page of our website.

Anthony
User
Posts: 155
Joined: 04-Oct-2006
# Posted on: 22-Mar-2010 23:44:40   

According to your example..its appears i have to create a class to do this..

[DependencyInjectionInfo(typeof(OrderEntity), "Validator")]
[Serializable]
public class OrderValidator : ValidatorBase
{
 ....
 }

is this correct?

Anthony
User
Posts: 155
Joined: 04-Oct-2006
# Posted on: 22-Mar-2010 23:51:57   

was the code autogenerated?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 23-Mar-2010 03:53:01   

You can write the code inside the entity class or outside (creating a validator class). Read more about that here.

And not, the class you mentioned (OrderValidator) is not autogenerated. If you want that, you can create your own templates to generate such classes.

David Elizondo | LLBLGen Support Team