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
|
Any reason we can't have entity metadata generated as part of the model so instead of using Entity.Attribute("LastName") we can use Entity.Attribute(Customer.LastName)? When refactoring the DB it would be nice to see design-time errors instead of hitting them at runtime after screwing up references to columns in Search and Replace operations. Maybe I'm missing something obvious? Thanks. |
|
|
If you have a look at the generated code for your model classes you will notice we generate out a set of *Field constants as part of the entity definition which provides the field names for reference exactly as you have indicated above. So you can use:
|
|
|
Thanks JB - should have worked that out for myself :| For completeness - what about identity field names? At the moment they appear as strings where I'm putting together Query objects that use Entity.Attribute to do bulk updates using the 'In' method. Thanks :) |
|
|
The identity field is always called Id :) Or are you dealing with a composite key?
|
|
|
Nah - just me being pedantic. I've changed all the other non-key refs and there's only 4 'strings' left in the app, so it's all good :) Thanks, Alan |
|