示例#1
0
        private static void AnalyzeResourceExpression(LambdaExpression lambda, ResourceExpression resource)
        {
            PathBox pb = new PathBox();

            ProjectionAnalyzer.Analyze(lambda, pb);
            resource.Projection  = new ProjectionQueryOptionExpression(lambda.Body.Type, lambda, pb.ProjectionPaths.ToList());
            resource.ExpandPaths = pb.ExpandPaths.Union(resource.ExpandPaths, StringComparer.Ordinal).ToList();
        }
示例#2
0
            internal override Expression VisitMethodCall(MethodCallExpression m)
            {
                if (ProjectionAnalyzer.IsMethodCallAllowedEntitySequence(m))
                {
                    ProjectionAnalyzer.CheckChainedSequence(m, this.type);

                    return(base.VisitMethodCall(m));
                }

                if ((m.Object != null ? CommonUtil.IsClientType(m.Object.Type) : false) ||
                    m.Arguments.Any(a => CommonUtil.IsClientType(a.Type)))
                {
                    throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, SR.ALinqExpressionNotSupportedInProjection, this.type, m.ToString()));
                }

                return(base.VisitMethodCall(m));
            }
示例#3
0
            internal override Expression VisitMethodCall(MethodCallExpression m)
            {
                /*
                 * if ((m.Object != null && ProjectionAnalyzer.IsDisallowedExpressionForMethodCall(m.Object))
                 || m.Arguments.Any(a => ProjectionAnalyzer.IsDisallowedExpressionForMethodCall(a)))
                 ||{
                 || throw new NotSupportedException(string.Format(SR.ALinqExpressionNotSupportedInProjection, this.type, m.ToString()));
                 ||}
                 */

                if (ProjectionAnalyzer.IsMethodCallAllowedEntitySequence(m))
                {
                    ProjectionAnalyzer.CheckChainedSequence(m, this.type);

                    return(base.VisitMethodCall(m));
                }

                throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, SR.ALinqExpressionNotSupportedInProjectionToEntity, this.type, m.ToString()));
            }
示例#4
0
 internal override Expression VisitMemberInit(MemberInitExpression init)
 {
     ProjectionAnalyzer.Analyze(init, this.box);
     return(init);
 }
示例#5
0
 internal override Expression VisitLambda(LambdaExpression lambda)
 {
     ProjectionAnalyzer.Analyze(lambda, this.box);
     return(lambda);
 }