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 Metadata 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.
propertyBuilder.IsVisible("Salary > 10000")
Enabled
Set a constant enabled.
property.IsEnabled(false)
Calculate enabled from an expression created by parsing a text.
property.IsEnabled("Salary > 10000")
Read-only
Set a constant read-only.
property.IsReadOnly(true)
Calculate read-only from an expression created by parsing a text.
property.IsReadOnly("Salary > 10000")
Instruction text
Set a constant read-only.
property.Instruction("Person details")