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
|
Hi, I've noticed that when viewing or editing the contents of an Entity in a dynamic data website, the Discriminator column of inheritance relationships is displayed and editable. Is there any way that LightSpeed could hide this field and automatically handle the creation of sub-classes? Or are there any suggested ways to deal with this situation in a DD website? Thanks, Chris PS: I've got the 28th July build installed but haven't had time to use it today. I'll respond to the other posts tomorrow. |
|
|
Hmm, this could be problematic. If the user creates an instance of a derived type (e.g. if you have Employee and Manager classes, and the user goes to the Managers list and selects Insert), LightSpeed sets the discriminator automatically (as part of setting up and saving the new Manager object). But if a knowledgeable user is browsing at the base class level they might want to see the discriminator so as to know the kind of entity. My suggestion would be to make the discriminator property read-only at the class level. The designer doesn't directly support this but you can do it by setting the property's Generation to FieldOnly and writing the property wrapper yourself -- or you could hide the discriminator completely by having no property wrapper at all! This should be benign because you will not normally be wanting to set the discriminator from your code anyway (you'll be creating instances of the derived class). And LightSpeed won't mind because it addresses the underlying backing field rather than the wrapper property. Please note I have not tried this out -- if it doesn't help, let us know, and we will see if we can come up with something else! |
|
|
Hi, This does seem to work as expected (I completely hid the property). I'll let you know if I ever come across any unwanted side-effects. Thanks, Chris |
|