EnumNvlExpression

What it is

EnumNvlExpression is used specify how to treat a NULL value in a Enum property (or field or variable). If the Enum appears to be NULL, it will be assigned a default value or a specified value.

Code example

public ReadOnlyEnumProperty EnumNvlExample
{
	get 
	{ 
		return CalculatedEnumProperty(() => 
			Operation.EditItem.TaxType.Nvl(TaxDefault)); 
	}
}

 

Explanation of the example

The example above works as follows.

  • Line 1 defines a ReadOnlyEnumProperty with the name EnumNvlExample.
  • In Line 5 and 6 the content of this property is going to be calculated and assigned.
  • In line 6, the Enum Operation.EditItem.TaxType is evaluated, by adding .Nvl.
  • If the Enum appears to be NULL, then EnumNvlExample will be assigned the value after Nvl between parentheses. In this case, the Enum TaxDefault will be assigned.