Can't initialize an entity with custom validator

Posts   
 
    
Gabor
User
Posts: 97
Joined: 29-Jan-2005
# Posted on: 17-May-2005 08:12:16   

Hi,

I'm using adapter.

I created an EntityValidator, but when I Try to initialize the entity with them, I get an overload resolution failed error, despite the fact, that the entity has the appropriate constructor.

dim MyValidator as new ItemValidator

dim entity as New ItemEntity(MyValidator)

What am I missed?

Thanks in advance

Gabor

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 17-May-2005 11:32:17   

There are 2 types of validators: field validators and entity validators. Field validators are generated, entity validators aren't, you have to implement these yourself by implementing IEntityValidator.

You're passing in the generated validator? What does "overload resolution failed error" mean exactly? (compile error I'm sure, that it can't find a proper method to use, because type not found). If you're passing in an IEntityValidator implementation, use: entity.EntityValidatorToUse = new ItemValidator()

Frans Bouma | Lead developer LLBLGen Pro
Gabor
User
Posts: 97
Joined: 29-Jan-2005
# Posted on: 17-May-2005 11:38:49   

Thanks Frans,

I want ot use the Entity validator, but I set it in a constructor as it would be an ItemValidator cry

After setting the entity.EntityValidatorToUse, everything works well.

smile

Thanks

Gabor