Anwendungsfälle Expressions

This chapter goes into detail on the actual hooks in the metadata that accept expressions as input.

Values

When a property is assigned a value generator, it is considered to be a Calculated Properties. The methods for creating calculated properties build on the SetValueExpression() family of methods.

Calculate the value from an expression created by parsing a text.

propertyBuilder.ValueExpression("UtcNow")

Default values

Any property can have a default value. Where possible, this value is mapped as the default value in the database. It is also used to initialize objects in memory.

Calculate the default value from an expression created by parsing a text.

propertyBuilder.DefaultValueExpression("UtcToday")

UI features

There are convenience methods for many common visual settings.

  • Visible (boolean)

  • Enabled (boolean)

  • Read-only (boolean)

  • Required (boolean)

  • Description (string)

  • Instruction text (string)

For all of these methods, note that the "last call wins": any existing expression is replaced by the new call.

Visible

Set a constant visibility.

propertyBuilder.IsVisible(false)

Calculate visibility from an expression created by parsing a text.

Enabled

Set a constant enabled.

Calculate enabled from an expression created by parsing a text.

Read-only

Set a constant read-only.

Calculate read-only from an expression created by parsing a text.

Instruction text

Set a constant read-only.

Â