Ejemplo n.º 1
0
        public static ExpressionInfo <Func <object[], object> > CreateComplexExpressionInfo()
        {
            var stateParamExpr = Expression.Parameter(typeof(object[]));

            var expr = ExpressionInfo.Lambda <Func <object[], object> >(
                ExpressionInfo.MemberInit(
                    ExpressionInfo.New(_ctorOfA,
                                       ExpressionInfo.New(_ctorOfB),
                                       ExpressionInfo.Convert(
                                           ExpressionInfo.ArrayIndex(stateParamExpr, ExpressionInfo.Constant(11)),
                                           typeof(string)),
                                       ExpressionInfo.NewArrayInit(typeof(ID[]),
                                                                   ExpressionInfo.New(_ctorOfD1),
                                                                   ExpressionInfo.New(_ctorOfD2))),
                    ExpressionInfo.Bind(_propAProp,
                                        ExpressionInfo.New(_ctorOfP,
                                                           ExpressionInfo.New(_ctorOfB))),
                    ExpressionInfo.Bind(_fieldABop,
                                        ExpressionInfo.New(_ctorOfB))),
                stateParamExpr);

            return(expr);
        }