Release notes for re-motion version 1.13.66

List of Issues

New Features

Details

[RM-2975] TupleExpressionBuilder

Component/s: Data.Linq
Issue Type: New Feature
Resolution: Fixed
Status: Closed


TupleExpressionBuilder can be used to build tuples incorporating a sequence of expressions. For example, given three expressions, ex1, ex2, and ex3, it will build nested NewExpressions that are equivalent to the following: new KeyValuePair<T1, KeyValuePair<T2, T3>> (ex1, new KeyValuePair<ex2, ex3>).

Given an expression whose type matches that of a tuple built by TupleExpressionBuilder, the builder can also return an enumeration of accessor expressions that can be used to access the tuple elements in the same order as they were put into the nested tuple expression. In above example, this would yield tupleEx.Key, tupleEx.Value.Key, and tupleEx.Value.Value.

This class can be handy whenever a set of expressions needs to be put into a single expression (eg., a select projection), especially if each sub-expression needs to be explicitly accessed at a later point of time (eg., to retrieve the items from a statement surrounding a sub-statement yielding the tuple in its select projection).