Bypass call to ValidateEntityBeforeSave

Posts   
 
    
imakimak
User
Posts: 62
Joined: 18-Mar-2010
# Posted on: 17-Jul-2012 22:43:11   

LLBL Gen Pro v 2.6/SQL Server 2008/.net 3.5/Self Servicing

For my entity I have created a validator class that drives from ValidatorBase. I am doing my validations in ValidateEntityBeforeSave method. The entity itself is saved through commit on unitofwork. Everything was fine until we came across some situations where we dont want to run all those validation checks when saving the entity. Is there anyway to bypass call to ValidateEntityBeforeSave during runtime? I guess I can just set Validator property of that entity to null but not sure if that's best way of doing it?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 18-Jul-2012 00:17:37   

Yes, you can set it null.