Home > Developing Using CodeFluent Entities > CodeFluent Entities: Member Format Expressions (Part 1)

CodeFluent Entities: Member Format Expressions (Part 1)


Using CodeFluent Entities, you can use “Member Format Expressions” to customize the way names of entities and properties are formatted:

image

Several expressions are provided by default but you can also define your own expressions by selecting “Choose” (you do this from the “Modeler Tab” of the ribbon or from the contextual menu):

image

Clicking “Add New” will allow you to define your own:

image

Creating this one will display “Test!” for all my properties:

image

It’s not that useful in practice, but still, it illustrates that you can set whatever you want in it and most importantly that it supports literals Smile

As you can see, the default expressions use property paths surrounded by curly brackets such as {Name} and {DisplayTypeName} to displays values from the model. You can access a list of available property paths by clicking on the “Insert Property Path” button which will display the following dialog:

image

For instance, here’s an expression displaying the property name and indicating if the property is a key between parenthesis:

image

Here’s the result on my Address entity:

image

If you prefix your property path with a ‘#’, the value will be decamelized. For instance the expression “{#Name} (IsKey={IsKey})” will display (the difference is visible on the Line1 and Line2 properties):

image

Sweet isn’t it?! Smile

It for sure is a nice feature too change as you can change how the model is presented with a single expression, however use format expressions with caution though, because as they’re evaluated to display each of your properties in your model, big expressions doing a lot of stuff and displaying a lot of text can become a performance killer on big models.

Carl Anderson

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 49 other followers