Print Page | Close Window

IdeaBlade.Verification.v4.VerifierResultException: Value is required

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1064
Printed Date: 21-Jan-2026 at 2:54am


Topic: IdeaBlade.Verification.v4.VerifierResultException: Value is required
Posted By: smiller
Subject: IdeaBlade.Verification.v4.VerifierResultException: Value is required
Date Posted: 21-Jan-2009 at 10:34am
I have an entity with a string property.  In my EF model on the S-side and C-side it's nullable attribute is set to "false".  When I try to set the value of this property to String.Empty I get a "IdeaBlade.Verification.v4.VerifierResultException: Value is required" exception from "IdeaBlade.EntityModel.v4.Entity.BeforeSet(SetterArgs`1 setterArgs) +181"
 
I would expect this exception if I tried to set the value to null, but I'm surprised by this exception when I try to set the value to String.Empty.
 
In order for me to workaround this issue I have to modify my EF model to set this properties nullable attribute to "true" on both the S-side and C-side.  This seems like an indesirable change to make because it would seem to modify the model in a way that's not consistent with the database schema.
 
Is this behavior by design?



Replies:
Posted By: eileenv
Date Posted: 26-Jan-2009 at 5:24pm

Currently this is by design; the Verification engine treats empty (blank) strings as null. We have an open Feature request in our Classic product that would give users the ability to specify whether or not they want the Verification engine to allow empty strings for non-nullable string types. I will open a Feature request in our EF product so that we can address this issue there as well.

One alternative workaround you may consider in the interim is to "turn the verifier off" for the string properties in which you want to allow empty strings:
 

1. Open up the Object Mapper.

2. Go to the property for which you want to allow the empty string.

3. In the Verification Setter Mode column, set the value to None.

4. Click Save to regenerate your model.

Of course, this may not be feasible if you have hundreds of String properties in question. And, keep in mind, turning off verification for those properties could allow bad data, e.g. null values or strings exceeding the maxlength, to get passed to the database.




Print Page | Close Window