Documentation
Table of Contents

Enum MappingOp

Namespace
IntentSharp.Mapping
Assembly
IntentSharp.dll

The closed vocabulary a compiled mapping is written in. Each op reads its sources and writes one target member; no op evaluates an expression, runs a regular expression or reads meaning from text. A stored mapping that names an op this library does not know fails to load. In JSON each op is written in camel case, such as "parseDate".

public enum MappingOp
Extension Methods

Fields

[JsonStringEnumMemberName("add")] Add = 26

Adds two or more numbers; the result is a decimal, and null when any source is null.

[JsonStringEnumMemberName("coalesce")] Coalesce = 2

Writes the first of two or more sources of one type that is not null.

[JsonStringEnumMemberName("concat")] Concat = 9

Joins two or more fixed-format strings with a separator.

[JsonStringEnumMemberName("constant")] Constant = 1

Writes a literal of the target's type; a string literal must appear verbatim in the intent, the expected output description, the system instructions, a declared list or the target enum.

[JsonStringEnumMemberName("convert")] Convert = 31

Runs a converter you registered by name (MappingConverterRegistry) on one or two sources. A stored mapping holds only the name; a name the client does not register refuses the mapping, and a converter that throws fails the step with ConverterFailed.

[JsonStringEnumMemberName("copy")] Copy = 0

Copies one source to the target: the same type, or a widening (byte to int16 to int32 to int64 to decimal, single to double).

[JsonStringEnumMemberName("count")] Count = 29

Writes the number of items of an array; null when the array is missing.

[JsonStringEnumMemberName("defaultIfNull")] DefaultIfNull = 3

Copies one source, or writes a literal when the source is null.

[JsonStringEnumMemberName("each")] Each = 25

Maps every item of an array with nested steps; the output keeps the length and the order.

[JsonStringEnumMemberName("formatDate")] FormatDate = 19

Writes a date or time value as text in a format.

[JsonStringEnumMemberName("formatNumber")] FormatNumber = 20

Writes a number as text in a format, with the given separators.

[JsonStringEnumMemberName("lookup")] Lookup = 23

Maps a value of a closed set (an enum, a boolean or a declared list) to a literal through a table; a missing key fails.

[JsonStringEnumMemberName("lower")] Lower = 7

Lower-cases a string with the invariant culture.

[JsonStringEnumMemberName("multiply")] Multiply = 27

Multiplies two or more numbers, such as a quantity and a price; the result is a decimal, and null when any source is null.

[JsonStringEnumMemberName("nullIf")] NullIf = 4

Copies one source, or writes null when it equals one of the given literals (for example a declared "N/A").

[JsonStringEnumMemberName("parseBool")] ParseBool = 16

Reads a string as a boolean from declared true and false tokens; any other token fails.

[JsonStringEnumMemberName("parseDate")] ParseDate = 17

Reads a string as a date with exact, stated formats.

[JsonStringEnumMemberName("parseDateTime")] ParseDateTime = 18

Reads a string as a date and time with exact, stated formats, in a declared IANA time zone unless every format carries an offset.

[JsonStringEnumMemberName("parseDecimal")] ParseDecimal = 14

Reads a string as a decimal with the declared separators.

[JsonStringEnumMemberName("parseDouble")] ParseDouble = 15

Reads a string as a double with the declared separators.

[JsonStringEnumMemberName("parseInt")] ParseInt = 12

Reads a string as a 32-bit integer with the declared separators.

[JsonStringEnumMemberName("parseLong")] ParseLong = 13

Reads a string as a 64-bit integer with the declared separators.

[JsonStringEnumMemberName("round")] Round = 22

Rounds a decimal or double to a number of decimals with a stated mode.

[JsonStringEnumMemberName("scale")] Scale = 21

Multiplies a number by a decimal factor; the result is a decimal.

[JsonStringEnumMemberName("split")] Split = 10

Splits a fixed-format string on a separator and writes the part at an index.

[JsonStringEnumMemberName("sum")] Sum = 28

Adds a number member of every item of an array (a source such as /lines/*/amount), or every item of an array of numbers; nulls are skipped, an empty array sums to 0 and a missing array gives null. The result is a decimal.

[JsonStringEnumMemberName("switch")] Switch = 24

Maps a value of a closed set to a literal or another source through cases, with a fallback that fails or writes a literal.

[JsonStringEnumMemberName("take")] Take = 11

Writes the part of a fixed-format string at a start position and length.

[JsonStringEnumMemberName("toString")] ToString = 8

Writes an integer, GUID, boolean or enum as text; decimals and dates use FormatNumber and FormatDate.

[JsonStringEnumMemberName("trim")] Trim = 5

Removes white space from both ends of a string.

[JsonStringEnumMemberName("upper")] Upper = 6

Upper-cases a string with the invariant culture.

[JsonStringEnumMemberName("whenEquals")] WhenEquals = 30

Compares a value of a closed set (an enum, a boolean or a declared list) with a literal of that set and runs the step in Then when they are equal, or the one in ElseStep when they are not; both write this step's target.

Remarks

The set is closed: an op the executor could not run would have to be refused, so the enum has no Other member.