Пример #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();
        }
Пример #2
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();
        }
Пример #3
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();
            }
        }
Пример #4
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();
        }
Пример #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:
                        NonEntityProjectionAnalyzer.Analyze(e.Body, pb);
                        break;
                }
            }

            pb.PopParamExpression();
        }
Пример #6
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();
            }
        }