This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I have perhaps ask this before. But way "codegen" generate default it just [ValidateUri] and not [ValidateUri(UriType = UriKind.RelativeOrAbsolute)] ? |
|
|
Because it would break existing users who depend on it performing absolute URI validation (and marking relative URIs as invalid). At some point we will update the designer so that users can customise the URI validation to specify the UriKind rather than just yes or no. But I believe you're using the command-line generator, so this won't be much good for you I'm afraid. The issue as we've said before is that the database just doesn't contain enough metadata to infer the domain model with complete accuracy. Even our decision on when to apply attributes is heuristic -- it is easy to construct a column that isn't meant to be a URI, but which causes us to infer the ValidateUriAttribute, and vice versa. There's certainly no way for us to tell *how* the URI should be validated, any more than we can infer a range validation. We're not sure how to resolve this short of supporting some kind of metadata file that you could supply to lsgen alongside the connection string, which could contain additional instructions for inferencing fields, attributes, etc. I believe some databases support storing custom metadata but that is likely to be rather obscure for many people and I doubt it would be supported across all databases. We're open to feedback or suggestions here. |
|
|
codegen.exe I think I will wait for the "CodeGenTemplateHelper" you guys trying to make...then I will make all the template in CodeSmith so you guys can focus on other things :-) |
|