Prefetchpath, entitycollection and validator

Posts   
 
    
sami
User
Posts: 93
Joined: 28-Oct-2005
# Posted on: 07-Feb-2006 14:44:07   

Time for some help again. I am using adapter scenario and I am fetching an entitycollection from db. And I want to use custom validator, ok, I can do this:


EntityCollection col= new EntityCollection(new EntityFactory(), new CustomValidator());
etc.

How to set customvalidator for related collections also? Or do I just set those manually by looping the required objects.


foreach (myobject myobj in col)
{
   foreach (myrelatedobject relobj in myobj.somecollection)
   {
          relobj.validator = new anothercustomvalidator();
   }
}

How about adding override to prefetchpath Add method for passing custom validators?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 07-Feb-2006 14:59:49   

Did you consult the "Using the generated code - Adding your own code to the generated classes" in the LLBLGen Pro documententation?

sami
User
Posts: 93
Joined: 28-Oct-2005
# Posted on: 07-Feb-2006 15:16:32   

a.k.a rtfm. Anyhow, I am setting EntityValidatorToUse in InitClassEmpty, I guess it should work if I set Validator there also then.