Print Page | Close Window

Generated properties with StringLengthVerifier are NOT updated when DB changes

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=1450
Printed Date: 22-Jan-2026 at 8:38pm


Topic: Generated properties with StringLengthVerifier are NOT updated when DB changes
Posted By: viola
Subject: Generated properties with StringLengthVerifier are NOT updated when DB changes
Date Posted: 31-Aug-2009 at 10:01pm
Hello DevForce Support,
 
Would you please explain how to trigger the auto-generation of verifiers? Particularly StringLengthVerifier. Because I didn't find relevant settings in object mapper. And my problem is that, for instance not all tables with similar columns(string) will have verifiers generated for the properties in their Entity counterparts. Additionally for those generated, say if the maxlength is set to 250, when table updated and change max length to 150, this change won't be reflected into the latest design.cs, so verifier is still checking against length 250.
 
Thanks.
Viola 



Replies:
Posted By: GregD
Date Posted: 02-Sep-2009 at 8:45am
As for the second question: the Entity Framework is conservative in its changes to the Conceptual model, since it does not and cannot know what aspects of that model you want to parallel the Storage schema, and which you do not. You could have your own reasons for wanting the allowed string length in the application to be longer than the one persisted to the database. It would be an unusual case, but somewhere out there, there's somebody with a use case that needs it.

As for the first case, I'm unaware of circumstances where some string columns trigger the generation of string length verifiers and others do not.  I'll ask around.


Posted By: GregD
Date Posted: 02-Sep-2009 at 2:46pm
If the columns are defined with a MaxLength of Max then the string length attribute should not be generated. Otherwise, they should appear. Let us know if you're seeing something different.



Print Page | Close Window