Hi
I am trying to upgrade my application to v2.0 from v1.2005 and I have a problem with validator classes.
In v1.2005 I generated a set of manager classes in a project I called SABER.Engine.BusinessObjects
As part of these manager classes I generated a set of validator classes (one for each entity) I.E. namespace SABER.Engine.BusinessObjects.ValidatorClasses.
I then used EntityValidatorToUse method to set the relevant validator and everything worked fine.
Under V2.0 I have a problem
EntityValidatorToUse is obsolete, as per the user manual I now need to use an include template to add a CreateValidate method to my EntityClasses as per the user guide
// C#
/// <summary>
/// Creates the validator object for this entity. Routine is called from the entity constructor. Implem
ent in an entity
/// class to set a particular entity validator object at construction time.
/// </summary>
/// <returns>New validator instance for this entity</returns>
protected override IValidator CreateValidator()
{
return new SABER.Engine.BusinessObjects.ValidatorClasses.CustomerValidator();
}
But of course if I do this I get circular reference problems because my BusinessObjects namespace relies on DBGeneric and DBGeneric relies on BusinessObjects.
The alternative approach (per the user guide) is to turn on the LLBL validator class and put my validation code into that class instead, however I have the same issue because my validator code itself relies on the BusinessObject namespace but when I try to reference in the BusinessObjects project I get circular errors.
Is there a way around this problem?
Many thanks