Ejemplo n.º 1
0
        internal static void Analyze(LambdaExpression e, PathBox pb)
        {
            bool knownEntityType = ClientType.CheckElementTypeIsEntity(e.Body.Type);

            pb.PushParamExpression(e.Parameters.Last());

            if (!knownEntityType)
            {
                NonEntityProjectionAnalyzer.Analyze(e.Body, pb);
            }
            else
            {
                switch (e.Body.NodeType)
                {
                case ExpressionType.MemberInit:
                    EntityProjectionAnalyzer.Analyze((MemberInitExpression)e.Body, pb);
                    break;

                case ExpressionType.New:
                    throw new NotSupportedException(Strings.ALinq_CannotConstructKnownEntityTypes);

                case ExpressionType.Constant:
                    throw new NotSupportedException(Strings.ALinq_CannotCreateConstantEntity);

                default:
                    NonEntityProjectionAnalyzer.Analyze(e.Body, pb);
                    break;
                }
            }

            pb.PopParamExpression();
        }
Ejemplo n.º 2
0
        private static void Analyze(LambdaExpression e, PathBox pb, DataServiceContext context)
        {
            bool flag = ClientTypeUtil.TypeOrElementTypeIsEntity(e.Body.Type);
            ParameterExpression pe = e.Parameters.Last<ParameterExpression>();
            bool flag2 = ClientTypeUtil.TypeOrElementTypeIsEntity(pe.Type);
            if (flag2)
            {
                pb.PushParamExpression(pe);
            }
            if (!flag)
            {
                NonEntityProjectionAnalyzer.Analyze(e.Body, pb, context);
            }
            else
            {
                switch (e.Body.NodeType)
                {
                    case ExpressionType.Constant:
                        throw new NotSupportedException(System.Data.Services.Client.Strings.ALinq_CannotCreateConstantEntity);

                    case ExpressionType.MemberInit:
                        EntityProjectionAnalyzer.Analyze((MemberInitExpression) e.Body, pb, context);
                        goto Label_0099;

                    case ExpressionType.New:
                        throw new NotSupportedException(System.Data.Services.Client.Strings.ALinq_CannotConstructKnownEntityTypes);
                }
                NonEntityProjectionAnalyzer.Analyze(e.Body, pb, context);
            }
        Label_0099:
            if (flag2)
            {
                pb.PopParamExpression();
            }
        }
Ejemplo n.º 3
0
        internal static void Analyze(LambdaExpression e, PathBox pb)
        {
            bool knownEntityType = ClientType.CheckElementTypeIsEntity(e.Body.Type);

            pb.PushParamExpression(e.Parameters.Last());

            if (!knownEntityType)
            {
                NonEntityProjectionAnalyzer.Analyze(e.Body, pb);
            }
            else
            {
                switch (e.Body.NodeType)
                {
                case ExpressionType.MemberInit:
                    EntityProjectionAnalyzer.Analyze((MemberInitExpression)e.Body, pb);
                    break;

                case ExpressionType.New:
                    throw new NotSupportedException(Strings.ALinq_CannotConstructKnownEntityTypes);

                case ExpressionType.Constant:
                    throw new NotSupportedException(Strings.ALinq_CannotCreateConstantEntity);

                default:
                    // ExpressionType.MemberAccess as a top-level expression is correctly
                    // processed here, as the lambda isn't being member-initialized.
                    NonEntityProjectionAnalyzer.Analyze(e.Body, pb);
                    break;
                }
            }

            pb.PopParamExpression();
        }
Ejemplo n.º 4
0
        private static void Analyze(LambdaExpression e, PathBox pb, DataServiceContext context)
        {
            bool flag = ClientTypeUtil.TypeOrElementTypeIsEntity(e.Body.Type);
            ParameterExpression pe = e.Parameters.Last <ParameterExpression>();
            bool flag2             = ClientTypeUtil.TypeOrElementTypeIsEntity(pe.Type);

            if (flag2)
            {
                pb.PushParamExpression(pe);
            }
            if (!flag)
            {
                NonEntityProjectionAnalyzer.Analyze(e.Body, pb, context);
            }
            else
            {
                switch (e.Body.NodeType)
                {
                case ExpressionType.Constant:
                    throw new NotSupportedException(System.Data.Services.Client.Strings.ALinq_CannotCreateConstantEntity);

                case ExpressionType.MemberInit:
                    EntityProjectionAnalyzer.Analyze((MemberInitExpression)e.Body, pb, context);
                    goto Label_0099;

                case ExpressionType.New:
                    throw new NotSupportedException(System.Data.Services.Client.Strings.ALinq_CannotConstructKnownEntityTypes);
                }
                NonEntityProjectionAnalyzer.Analyze(e.Body, pb, context);
            }
Label_0099:
            if (flag2)
            {
                pb.PopParamExpression();
            }
        }
Ejemplo n.º 5
0
        internal static void Analyze(LambdaExpression e, PathBox pb)
        {
            bool knownEntityType = ClientType.CheckElementTypeIsEntity(e.Body.Type);
            pb.PushParamExpression(e.Parameters.Last());

            if (!knownEntityType)
            {
                NonEntityProjectionAnalyzer.Analyze(e.Body, pb);
            }
            else
            {
                switch (e.Body.NodeType)
                {
                    case ExpressionType.MemberInit:
                        EntityProjectionAnalyzer.Analyze((MemberInitExpression)e.Body, pb);
                        break;
                    case ExpressionType.New:
                        throw new NotSupportedException(Strings.ALinq_CannotConstructKnownEntityTypes);
                    case ExpressionType.Constant:
                        throw new NotSupportedException(Strings.ALinq_CannotCreateConstantEntity);
                    default:
                        // ExpressionType.MemberAccess as a top-level expression is correctly
                        // processed here, as the lambda isn't being member-initialized.
                        NonEntityProjectionAnalyzer.Analyze(e.Body, pb);
                        break;
                }
            }

            pb.PopParamExpression();
        }
Ejemplo n.º 6
0
        internal static void Analyze(LambdaExpression e, PathBox pb)
        {
            bool knownEntityType = ClientType.CheckElementTypeIsEntity(e.Body.Type);
            pb.PushParamExpression(e.Parameters.Last());

            if (!knownEntityType)
            {
                NonEntityProjectionAnalyzer.Analyze(e.Body, pb);
            }
            else
            {
                switch (e.Body.NodeType)
                {
                    case ExpressionType.MemberInit:
                        EntityProjectionAnalyzer.Analyze((MemberInitExpression)e.Body, pb);
                        break;
                    case ExpressionType.New:
                        throw new NotSupportedException(Strings.ALinq_CannotConstructKnownEntityTypes);
                    case ExpressionType.Constant:
                        throw new NotSupportedException(Strings.ALinq_CannotCreateConstantEntity);
                    default:
                        NonEntityProjectionAnalyzer.Analyze(e.Body, pb);
                        break;
                }
            }

            pb.PopParamExpression();
        }