Log in

Enumerations in Modlr

From MDrivenWiki

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:

Enumerations -1.png

And then accept that Modlr treated your attribute of type string and not as an Enumerable:

Enumerations -2 .png

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):

Enumerations -3.png

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.