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
|
|
|
|
If you declare the field/property as the enum type, LightSpeed will automatically convert between the database integer and the enum. No need to decorate the property in any way. If you're hand-coding the entities, just declare the field/property as your enum type instead of Int32. If you're using the designer, there's a little bit of setup you need to do first, because you need to tell the designer about the enum type so it can display it in the drop-down. To do this: * Open the LightSpeed Model Explorer (View > Other Windows > LightSpeed Model if it's not already open). * Right-click the top node and choose Add New User Defined Type. * Right-click the newly created UserDefinedType1 and choose Properties. * In the Name field, enter the name of the enum as you'd like it displayed in the designer, e.g. Priority. * In the CLR Type Name field, enter the type name of the enum as it needs to appear in the generated code -- typically a fully-qualified type name e.g. WonderCorp.AwesomeApp.Priority. * You can leave the other options alone as they are the normal defaults for an enum mapping to an integer database column. Once you've defined the enum in this way, you can use it just like any other data type: select an entity property in the designer, go to the Properties window and select the enum from the Data Type drop-down box. |
|
|
Hi Ivan, great, this exactly what I needed. Thx Remo |
|