Boxed Expression Types

◷ Reading Time: 3 minutes

You can add different types of expression as boxed expressions.

  • Formula: To write formulas
  • Literal: To assign constants and literal formulas (without any parameters)
  • Function: To assign a function with a list of expressions
  • Native Method: To assign .NET native methods

Formula

To store expressions with parameters.

Properties

  • Name: Name of the expression
  • Expression: The expression you want to assign to the name
  • Parameters: The parameters used in the expression

Literal

To store constant values or expressions that only contain literal values.

Properties

  • Name: Name of the expression
  • Expression: The expression you want to assign to the name

Function

To store a set of expressions as one function.

Properties

  • Name: Name of the expression
  • Expressions: The list of expressions you want to assign to the name
  • Parameters: The parameters used in the expressions

The expressions in a function will be executed according to the given order of expressions and the last expression’s output will be returned as the function’s output.

Native Methods

To use the native methods available in .NET Framework.

You can add methods from the list of available functions in .NET Framework 4.7.

Properties

  • Name: Name of the expression
  • Type: Type of the native method
  • Method Signature: The default method signature

In the above figure, we use the method DateTime.DaysInMonth(Int32, Int32) .

Sample Project

The attached project (Boxed Expressions.zip) includes a set of examples for each expression type.

Updated on August 10, 2020

Article Attachments

Was this article helpful?

Related Articles