Table of Contents

Namespace Albatross.Expression.Prefix

Classes

Array

Prefix operation that create an object array

Operand Count: 0 to infinite

Operand Type: Any

Output Type: List<T> where T is Object

Usage: @(1, 2, 3, 4, 5)

ArrayItem

Return the value of a json array item based on the provided index

Avg

Prefix expression that calculates the arithmetic average of multiple numeric operands. Takes zero or more parameters and returns their mean value.

Concat

Prefix expression that concatenates multiple operands into a single string. Takes one or more parameters and joins them together without separators.

CreateDate

Prefix operation that create an date

Operand Count: 3

Operands

  1. year : double
  2. month : double
  3. day : double

Operand Type: int

Output Type: System.DateTime

Usage: CreateDate(2018, 1, 31)

CurrentApp

Prefix operation that returns the current app domain friendly name

Operand Count: 0

Output Type: string

CurrentMachine

Prefix operation that returns the current machine host name

Operand Count: 0

Output Type: string

DateTimeExpression

Prefix operation that convert input to DateTime

Operand Count: 1

Operands

  1. input : any

Output Type: System.DateTime

DayOfWeek

Prefix expression that extracts the day of the week from a DateTime value. Returns a numeric value representing the day (0=Sunday, 1=Monday, etc.).

Floor

Floor the current number and remove all decimals

Format

Prefix operation that will take an input and C# format string and produced a formatted string

GetJsonProperty

return the json property using the supplied path. Operand 1 is the input json value, if the input is text, it will be parsed into a json element. Operand 2 and beyond are the json property path.

If

Represents the conditional If function that returns different values based on a boolean condition. Takes three operands: condition, value if true, value if false.

JoinPath

Prefix expression that combines multiple path segments into a single file system path. Takes one or more string parameters and joins them using the appropriate path separator.

Left

Prefix operation that return the substring of the input text with the specified length and start index of 0

Operand Count: 2

Operands

  1. input: string
  2. count: double

Output Type: string

Usage: Left("test", 1) should return "t"

Len

Represents the Len function that returns the length of strings, collections, or JSON arrays.

Lower

Prefix expression that converts a string to lowercase using invariant culture.

MaxNumber

Prefix expression that finds the maximum value among multiple numeric operands. Takes one or more parameters and returns the largest numeric value.

MinNumber

Prefix expression that finds the minimum value among multiple numeric operands. Takes zero or more parameters and returns the smallest numeric value, or MaxValue if no operands.

Month

Prefix expression that extracts the month component from a DateTime value. Returns an integer representing the month (1-12).

MonthName

Prefix expression that returns the full month name from a DateTime value. Uses the current culture's formatting to return the localized month name.

NextWeekDay

Prefix expression that finds the next weekday (Monday-Friday) from a given date. Takes 1-2 parameters: the starting date and optional number of weekdays to advance (defaults to 1).

Not

Represents the logical NOT function that inverts a boolean value.

Now

Prefix expression that returns the current local date and time. Takes no parameters and returns DateTime.Now.

Number

Prefix expression that converts an operand to a numeric (double) value. Takes exactly one parameter and performs type conversion to double.

PadLeft

Prefix expression that pads a string to a specified total length by adding characters to the left. Takes 2-3 parameters: source string, total width, and optional padding character (defaults to space).

PadRight

Prefix expression that pads a string to a specified total length by adding characters to the right. Takes 2-3 parameters: source string, total width, and optional padding character (defaults to space).

PrefixExpression

Base implementation for prefix function expressions that operate on multiple operands.

PreviousWeekDay

Prefix expression that finds the previous weekday (Monday-Friday) from a given date. Takes 1-2 parameters: the starting date and optional number of weekdays to go back (defaults to 1).

Random

Prefix expression that generates a random integer within a specified range. Takes two parameters: minimum (inclusive) and maximum (exclusive) values.

RegexCapture

The operation use Regex to capture a part of the input text. It takes 3 parameters. parameter 1 (text): the text to be parsed parameter 2 (text): a regex pattern parameter 3 (integer): Captured group index. If regex matches, return the specified captured group value. The default value is 0 if not specified

Right

Prefix expression that extracts a specified number of characters from the right side of a string. Takes two parameters: the source string and the number of characters to extract.

Round

Perform a mid point rounding away from zero. First operand is the input, second operand is the number of digits.

ShortMonthName

Prefix expression that returns the abbreviated month name from a DateTime value. Uses the current culture's formatting to return the localized short month name.

Text

Prefix expression that converts an operand to its string representation. Takes exactly one parameter and performs type conversion to string.

Today

Prefix expression that returns the current date at midnight (start of day). Takes no parameters and returns DateTime.Today.

UnixTimestamp

Prefix operation that convert a DateTime to the number of seconds that have elapsed since 1970-01-01T00:00:00Z. It is also called unix timestamp. If the input is not DateTime, the operand is converted to text first and parsed to a datetime object

Operand Count: 1

Operands

  1. input : any

Output Type: long

Upper

Prefix expression that converts a string to uppercase using invariant culture.

Utc

Convert a dateTime object to utc. If the input operand is a string, the function will attempt to parse it first.

UtcNow

Prefix expression that returns the current Coordinated Universal Time (UTC). Takes no parameters and returns DateTime.UtcNow.

Year

Prefix expression that extracts the year component from a DateTime value. Returns an integer representing the year.