예제 #1
0
        public Expression ToExpression()
        {
            var newExpr = _constructor.ToExpression();

            if (!_setters.Any())
            {
                return(newExpr);
            }

            return(Expression.MemberInit(newExpr, _setters.Select(x => x.ToBinding())));
        }
예제 #2
0
        private Expression buildInnerExpression(ParameterExpression session, ParameterExpression context)
        {
            var newExpr = _constructor.ToExpression(session, context);

            if (!_setters.Any())
            {
                return(newExpr);
            }


            return(Expression.MemberInit(newExpr, _setters.Select(x => x.ToBinding(session, context))));
        }