internal static void CheckChainedSequence(MethodCallExpression call, Type type) { if (ReflectionUtil.IsSequenceSelectMethod(call.Method)) { MethodCallExpression expression = ResourceBinder.StripTo <MethodCallExpression>(call.Arguments[0]); if ((expression != null) && ReflectionUtil.IsSequenceSelectMethod(expression.Method)) { throw new NotSupportedException(System.Data.Services.Client.Strings.ALinq_ExpressionNotSupportedInProjection(type, call.ToString())); } } }
/// <summary> /// Checks whether the specified <see cref="MethodCallExpression"/> refers /// to a Select method call that works on the results of another Select call /// </summary> /// <param name="call">Method call expression to check.</param> /// <param name="type">Type of the projection</param> internal static void CheckChainedSequence(MethodCallExpression call, Type type) { if (ReflectionUtil.IsSequenceSelectMethod(call.Method)) { // Chained Selects are not allowed // c.Orders.Select(...).Select(...) MethodCallExpression insideCall = ResourceBinder.StripTo <MethodCallExpression>(call.Arguments[0]); if (insideCall != null && (ReflectionUtil.IsSequenceSelectMethod(insideCall.Method))) { throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjection(type, call.ToString())); } } }