Author |
Share Topic Topic Search Topic Options
|
JST
Newbie
Joined: 16-Jun-2010
Location: Netherlands
Posts: 8
|
Post Options
Quote Reply
Topic: Verification attributes on generated properties Posted: 25-Jun-2010 at 3:17am |
Right, it gets generated on new model. To bad it can't be done when doing update. Oh well, I guess this will be an hour or two renaming properties and copying the right partial files again. It'll work out. Thanks.
Edited by JST - 25-Jun-2010 at 3:18am
|
|
GregD
IdeaBlade
Joined: 09-May-2007
Posts: 374
|
Post Options
Quote Reply
Posted: 21-Jun-2010 at 8:50am |
The generation of that attribute in the CSDL would be up to the Entity Framework. Try generating a fresh model against the same table(s) and see if it gets generated.
|
|
JST
Newbie
Joined: 16-Jun-2010
Location: Netherlands
Posts: 8
|
Post Options
Quote Reply
Posted: 21-Jun-2010 at 1:06am |
That seems indeed to be the problem. So, the logical next question is: How do I have this property autogenerated? I set one by hand, and indeed the attribute was there. So far so good. But now ...? Any inside information on this? Thanks.
|
|
GregD
IdeaBlade
Joined: 09-May-2007
Posts: 374
|
Post Options
Quote Reply
Posted: 18-Jun-2010 at 2:58pm |
Also check the MaxLength attribute on the property in the CSDL. If for some reason the CSDL entities don’t have the MaxLength set for string properties, we won't generate the StringLengthVerifier.
|
|
GregD
IdeaBlade
Joined: 09-May-2007
Posts: 374
|
Post Options
Quote Reply
Posted: 18-Jun-2010 at 2:00pm |
I just tried it with 5.2.6 - made a brand new model with a couple of tables in NorthwindIB, generated the code, and the attributed verifiers are there as they should be. At first I didn't see them because I looked at the generated code associated with the EDMX instead of the IBEDMX. But I only did that because I spend most of my time in DevForce 2010 and there's *only* an EDMX in DF2010 solutions.
I just mention that on the off-chance you're also working with DF2010 and made the same mistake. But you're probably not as bone-headed as I am. 8-)
|
|
JST
Newbie
Joined: 16-Jun-2010
Location: Netherlands
Posts: 8
|
Post Options
Quote Reply
Posted: 17-Jun-2010 at 12:42am |
I do. Also unchecked, checked again, tried .net attributes, switched back to Ideablade. All to no avail.
|
|
GregD
IdeaBlade
Joined: 09-May-2007
Posts: 374
|
Post Options
Quote Reply
Posted: 16-Jun-2010 at 12:51pm |
Do you have the Generate Validation Attributes checkbox checked on the Entity Model node in the Object Mapper when you generate? Also the associated "DevForce" RadioButton selected?
|
|
JST
Newbie
Joined: 16-Jun-2010
Location: Netherlands
Posts: 8
|
Post Options
Quote Reply
Posted: 16-Jun-2010 at 7:22am |
Hi,
I'm using IB version 5.2.6.0. Now I would like to see stringlenght verifiers on my generated properties. But then never get generated. We're talking Silverlight here. Anything I can do or check?
When I manually add a verifier all goes well as expected. But going through a hundred+ entities to do this for all string properties isn't making me happy.
Any hints, tips, suggestions.
Thanks
Johan Storteboom
|
|