Esempio n. 1
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));
            }
Esempio n. 2
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()));
            }