Print Page | Close Window

Naming Verifiers

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2012
Forum Discription: For .NET 4.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=4221
Printed Date: 13-Mar-2025 at 3:08am


Topic: Naming Verifiers
Posted By: murray.bryant
Subject: Naming Verifiers
Date Posted: 10-Jul-2013 at 7:31pm
I have a number of verifiers in my model. A lot of which return warnings which are then logged into the database.

What I am looking to do is work out what the name of the verifier was that made the warning so that I can log it into the database.

In the Verifier Result Collection most of my errors come up not showing the original class that they are from ( Ie just saying they are delegate verifier)

Is there a way that this can be done easily? Is there a property I missed that I can set to name a custom verifier?

thanks

Murray



Replies:
Posted By: kimj
Date Posted: 12-Jul-2013 at 4:45pm
There's no "name" or "tag" property on the DelegateVerifier (or any Verifier) so there isn't a really easy way to do this.
 
There is additional information available from the VerifierResult that might still be useful though.  The TriggerContext will contain the instance type and trigger (property name), and the error message itself could also contain additional identifying information.    You can also subclass the DelegateProvider<T> to give your verifiers more meaningful class names.



Print Page | Close Window