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(); }
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(); } }
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(); }
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(); } }