예제 #1
0
        /// <summary>
        /// Constructs expression tree based on value tuple type.
        /// </summary>
        /// <typeparam name="E">Type of expression tree.</typeparam>
        /// <param name="expressionFactory">A function accepting value tuple type and returning expression tree.</param>
        /// <param name="expression">Constructed expression.</param>
        /// <returns>Sorted array of value tuple type components.</returns>
        public MemberExpression[] Build <E>(Func <Type, E> expressionFactory, out E expression)
            where E : Expression
        {
            expression = expressionFactory(Build());
            var fieldAccessExpression = new MemberExpression[Count];

            Build(expression, fieldAccessExpression.AsSpan());
            return(fieldAccessExpression);
        }