Skip to main content

Creating an in-line record


The value returned from an expression can be not only a scalar value, a pre-existing record (or lists of them). It is possible to create a small record structure with values using a syntax that is similar to creating an in-line collection. The expression compiler distinguishes between the two situations on the basis of content - if the elements are of different types, or are named, or contain structural elements, then we are dealing with the creation of an in-line record.

An example of an expression that creates an in-line record as the result of a mini-linq query, along with the resulting data structure:

from ..\A select
{
a,
bb=b,
a3="s",
Child=(from ..\A where 1>2 select {x="y"}),
ChildMandatory={z="v"}
}

image

See also​

Special cases: no value vs. empty value

Required boolean values of conditions

Functions