Passing data to a validator?

Posts   
 
    
edalzell
User
Posts: 44
Joined: 27-May-2008
# Posted on: 05-Feb-2009 20:49:31   

We use DI for our validation.

We have a RegistrationEntity that contains multiple DebtorEntities. We have a Debtor Validator and a RegistrationValidator.

The issue that has come up is that I need some information from the RegistrationEntity in my DebtorValidator. The DebtorEntity does not have a reference to RegistrationEntity.

Is there a way to pass information to a validator?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 06-Feb-2009 06:30:52   

Hi edalzell. Some questions:

  • Are you saving the whole graph (RegistrationEntity plus its related DebtorEntities) at once (recursive save)? or saving them separately?
  • Are all entities new (Registration and its Debtors)?
  • What is the method you want to access the RestrationEntity (ValidateEntityBeforeSave, ValidateFieldValue, etc.)?
  • Using Adapter or SelfServicing?
  • Please post some relevant code where you create and save the entities.
David Elizondo | LLBLGen Support Team