Enumerations in Modlr
One weakness that we recently rectified was the lack of enumeration definitions inside Modlr. Before you have to just assign an Enumerable type name to an attribute like so:
And then accept that Modlr treated your attribute of type string and not as an Enumerable:
This was simple because the Model was not informed about the Enumeration. In fact you had to define the enumeration some place in code yourself to get the CodeGen to use it.
But Now you can get up this dialog (add model elements, Edit Enumerations):
And in here you declare the enumeration name, values and code comments (and also the optional integer value).
If the CodeGen checkbox is checked we will add the enumeration to your code. The important thing here is that the model has been made more detailed by keeping the knowledge about enumerations inside the model, so that we can use the enumeration values in constraints, viewmodel validations etc.

10 Comments:
Not available in eco 5 version 5.0.0.5036. Which version and build has this?
TIA
throg
This was added recently so it went into Eco6. Eco6 is stable and we will publish an offical build for VS2008 and VS2010 asap; until then you can get it from the dailybuilds (VS2008)
guest00:
Hi Hans,
I got the latest buid 6.0.0.5061 but how to open this "EditEnums" window?
Thank you!
Right click on Package or class, add model elements, Edit enumerations
guest00: thank you, but the form is empty...
This form was created with a viewmodel and I created it in VS2010, what I forgot was to update the VS2008 project to embed the viewmodel file as a resource...
My bad, Sorry!
Fixed next build.
guest00:
Hi Hans,
I confirm that the form for enums is ok in the buld 6.0.0.5076
but you did something with viewmodel it is not possible to add the combo-column.
Should I use mantis for the daily builds?
Thank you,
Regards,
Alex
Thanks Alex,
What did I do? Tested and the combocolumns seems to work for me... Sure you have n..0 association to set?
If you want to create a combobox yourself, just add "other column" two times, say that one is pick list for the other. Yes you can use mantis.
So with this new feature do we still have to add enumeration to persistence mapper in the same way i.e. via SqlDatabaseConfig | PersistenceMappers?
The standard way to store the enum is with their string value. That has not changed.
If you are fine with this standard you need not to anything more to declare an enum than what is explained in the post above
Post a Comment
Subscribe to Post Comments [Atom]
<< Home