30 types derived from Expression
System.Core (25)
Microsoft\Scripting\Ast\BinaryExpression.cs (1)
39
public class BinaryExpression :
Expression
{
Microsoft\Scripting\Ast\BlockExpression.cs (1)
38
public class BlockExpression :
Expression
{
Microsoft\Scripting\Ast\ConditionalExpression.cs (1)
36
public class ConditionalExpression :
Expression
{
Microsoft\Scripting\Ast\ConstantExpression.cs (1)
36
public class ConstantExpression :
Expression
{
Microsoft\Scripting\Ast\DebugInfoExpression.cs (1)
38
public class DebugInfoExpression :
Expression
{
Microsoft\Scripting\Ast\DefaultExpression.cs (1)
30
public sealed class DefaultExpression :
Expression
{
Microsoft\Scripting\Ast\DynamicExpression.cs (1)
41
public class DynamicExpression :
Expression
, IDynamicExpression
Microsoft\Scripting\Ast\GotoExpression.cs (1)
57
public sealed class GotoExpression :
Expression
{
Microsoft\Scripting\Ast\IndexExpression.cs (1)
40
public sealed class IndexExpression :
Expression
, IArgumentProvider {
Microsoft\Scripting\Ast\InvocationExpression.cs (1)
38
public sealed class InvocationExpression :
Expression
, IArgumentProvider {
Microsoft\Scripting\Ast\LabelExpression.cs (1)
33
public sealed class LabelExpression :
Expression
{
Microsoft\Scripting\Ast\LambdaExpression.cs (1)
47
public abstract class LambdaExpression :
Expression
{
Microsoft\Scripting\Ast\ListInitExpression.cs (1)
43
public sealed class ListInitExpression :
Expression
{
Microsoft\Scripting\Ast\LoopExpression.cs (1)
35
public sealed class LoopExpression :
Expression
{
Microsoft\Scripting\Ast\MemberExpression.cs (1)
37
public class MemberExpression :
Expression
{
Microsoft\Scripting\Ast\MemberInitExpression.cs (1)
34
public sealed class MemberInitExpression :
Expression
{
Microsoft\Scripting\Ast\MethodCallExpression.cs (1)
39
public class MethodCallExpression :
Expression
, IArgumentProvider {
Microsoft\Scripting\Ast\NewArrayExpression.cs (1)
39
public class NewArrayExpression :
Expression
{
Microsoft\Scripting\Ast\NewExpression.cs (1)
40
public class NewExpression :
Expression
, IArgumentProvider {
Microsoft\Scripting\Ast\ParameterExpression.cs (1)
36
public class ParameterExpression :
Expression
{
Microsoft\Scripting\Ast\RuntimeVariablesExpression.cs (1)
36
public sealed class RuntimeVariablesExpression :
Expression
{
Microsoft\Scripting\Ast\SwitchExpression.cs (1)
38
public sealed class SwitchExpression :
Expression
{
Microsoft\Scripting\Ast\TryExpression.cs (1)
44
public sealed class TryExpression :
Expression
{
Microsoft\Scripting\Ast\TypeBinaryExpression.cs (1)
35
public sealed class TypeBinaryExpression :
Expression
{
Microsoft\Scripting\Ast\UnaryExpression.cs (1)
38
public sealed class UnaryExpression :
Expression
{
System.Data.Entity (1)
System\Data\Objects\ELinq\Funcletizer.cs (1)
598
internal sealed class QueryParameterExpression :
Expression
System.Data.Linq (1)
SqlClient\Common\Expressions.cs (1)
19
abstract internal class InternalExpression :
Expression
{
System.Data.Services.Client (3)
System\Data\Services\Client\ALinq\InputReferenceExpression.cs (1)
31
internal sealed class InputReferenceExpression :
Expression
System\Data\Services\Client\ALinq\QueryOptionExpression.cs (1)
20
internal abstract class QueryOptionExpression :
Expression
System\Data\Services\Client\ALinq\ResourceExpression.cs (1)
40
internal abstract class ResourceExpression :
Expression
6214 references to Expression
System.Activities (287)
Microsoft\CSharp\Activities\CSharpReference.cs (1)
69
public
Expression
GetExpressionTree()
Microsoft\CSharp\Activities\CSharpValue.cs (1)
70
public
Expression
GetExpressionTree()
Microsoft\VisualBasic\Activities\VisualBasicDesignerHelper.cs (9)
390
static void FindTypeReferences(
Expression
expression, HashSet<Type> typeReferences)
468
ReadOnlyCollection<
Expression
> arguments = listInit.Initializers[i].Arguments;
510
ReadOnlyCollection<
Expression
> arguments = arrayIndex.Arguments;
554
ReadOnlyCollection<
Expression
> callArguments = methodCall.Arguments;
564
ReadOnlyCollection<
Expression
> expressions = newArray.Expressions;
574
ReadOnlyCollection<
Expression
> boundExpressions = newArrayBounds.Expressions;
592
ReadOnlyCollection<
Expression
> ctorArguments = newExpression.Arguments;
632
ReadOnlyCollection<
Expression
> blockExpressions = block.Expressions;
664
ReadOnlyCollection<
Expression
> arguments = initializers[i].Arguments;
Microsoft\VisualBasic\Activities\VisualBasicHelper.cs (60)
46
typeof(
Expression
).Assembly, // System.Core
292
Expression
finalBody;
328
return
Expression
.Lambda(rawTree.Type, finalBody, rawTree.Parameters);
404
return
Expression
.Lambda(lambda.Type, finalBody, lambda.Parameters);
428
Expression
finalBody;
468
return
Expression
.Lambda<Func<ActivityContext, T>>(finalBody,
576
return
Expression
.Lambda<Func<ActivityContext, T>>(finalBody,
654
Expression
Rewrite(
Expression
expression, ReadOnlyCollection<ParameterExpression> lambdaParameters, out bool abort)
659
Expression
Rewrite(
Expression
expression, ReadOnlyCollection<ParameterExpression> lambdaParameters, bool isLocationExpression, out bool abort)
663
Expression
expr1;
664
Expression
expr2;
665
Expression
expr3;
666
List<
Expression
> arguments;
668
ReadOnlyCollection<
Expression
> tmpArguments;
721
return
Expression
.MakeBinary(
749
return
Expression
.Condition(expr1, expr2, expr3);
768
arguments = new List<
Expression
>(tmpArguments.Count);
779
return
Expression
.Invoke(expr1, arguments);
789
return
Expression
.Lambda(lambda.Type, expr1, lambda.Parameters);
807
arguments = new List<
Expression
>(tmpArguments.Count);
817
initializers.Add(
Expression
.ElementInit(tmpInitializers[i].AddMethod, arguments));
819
return
Expression
.ListInit(newExpression, initializers);
898
return
Expression
.MakeMemberAccess(expr1, memberExpression.Member);
921
return
Expression
.MemberInit(newExpression, bindings);
936
List<
Expression
> indexes = new List<
Expression
>(tmpArguments.Count);
946
return
Expression
.ArrayIndex(expr1, indexes);
959
return
Expression
.ArrayIndex(expr1, expr2);
974
arguments = new List<
Expression
>(tmpArguments.Count);
985
return
Expression
.Call(expr1, methodCall.Method, arguments);
990
ReadOnlyCollection<
Expression
> tmpExpressions = newArray.Expressions;
992
List<
Expression
> arrayInitializers = new List<
Expression
>(tmpExpressions.Count);
1002
return
Expression
.NewArrayInit(newArray.Type.GetElementType(), arrayInitializers);
1009
List<
Expression
> bounds = new List<
Expression
>(tmpExpressions.Count);
1019
return
Expression
.NewArrayBounds(newArrayBounds.Type.GetElementType(), bounds);
1035
arguments = new List<
Expression
>(tmpArguments.Count);
1056
return
Expression
.TypeIs(expr1, typeBinary.TypeOperand);
1073
return
Expression
.MakeUnary(unary.NodeType, expr1, unary.Type, unary.Method);
1083
return
Expression
.UnaryPlus(expr1, unaryPlus.Method);
1103
List<
Expression
> expressionList = new List<
Expression
>(tmpExpressions.Count);
1113
return
Expression
.Block(parameterList, expressionList);
1128
return
Expression
.Assign(expr1, expr2);
1139
Expression
expr1;
1140
ReadOnlyCollection<
Expression
> tmpArguments;
1152
return
Expression
.Bind(assignment.Member, expr1);
1165
List<
Expression
> arguments = null;
1170
arguments = new List<
Expression
>(tmpArguments.Count);
1181
initializers.Add(
Expression
.ElementInit(tmpInitializers[i].AddMethod, arguments));
1184
return
Expression
.ListBind(list.Member, initializers);
1201
return
Expression
.MemberBind(member.Member, bindings);
1209
static ParameterExpression FindParameter(
Expression
expression)
1326
List<
Expression
> variableList = new List<
Expression
>();
1342
static ParameterExpression FindParameter(ICollection<
Expression
> collection)
1344
foreach (
Expression
expression in collection)
Microsoft\VisualBasic\Activities\VisualBasicReference.cs (1)
118
public
Expression
GetExpressionTree()
Microsoft\VisualBasic\Activities\VisualBasicValue.cs (1)
118
public
Expression
GetExpressionTree()
System\Activities\Expressions\BinaryExpressionHelper.cs (5)
36
ParameterExpression leftParameter =
Expression
.Parameter(typeof(TLeft), "left");
37
ParameterExpression rightParameter =
Expression
.Parameter(typeof(TRight), "right");
41
BinaryExpression binaryExpression =
Expression
.MakeBinary(operatorType, leftParameter, rightParameter);
43
Expression
expressionToCompile = OperatorPermissionHelper.InjectReflectionPermissionIfNecessary(binaryExpression.Method, binaryExpression);
44
Expression<Func<TLeft, TRight, TResult>> lambdaExpression =
Expression
.Lambda<Func<TLeft, TRight, TResult>>(expressionToCompile, leftParameter, rightParameter);
System\Activities\Expressions\CompiledExpressionInvoker.cs (1)
180
internal
Expression
GetExpressionTree()
System\Activities\Expressions\ExpressionServices.cs (12)
52
static string TryConvert<TResult>(
Expression
body, bool throwOnError, out Activity<TResult> result)
173
static string TryConvertReference<TResult>(
Expression
body, bool throwOnError, out Activity<Location<TResult>> result)
409
Expression<Func<Variable>> funcExpression =
Expression
.Lambda<Func<Variable>>(methodCallExpression.Object);
551
Expression<Func<Variable>> funcExpression =
Expression
.Lambda<Func<Variable>>(methodCallExpression.Object);
606
Expression<Func<DelegateArgument>> funcExpression =
Expression
.Lambda<Func<DelegateArgument>>(methodCallExpression.Object);
661
Expression<Func<DelegateArgument>> funcExpression =
Expression
.Lambda<Func<DelegateArgument>>(methodCallExpression.Object);
693
Expression<Func<RuntimeArgument>> expr =
Expression
.Lambda<Func<RuntimeArgument>>(memberExpression, null);
1370
static string TryConvertArgumentExpressionWorker<TArgument>(
Expression
expression, bool isByRef, bool throwOnError, out System.Activities.Argument result)
1447
static string TryConvertArguments(ReadOnlyCollection<
Expression
> source, IList target, Type expressionType, int baseEvaluationOrder, ParameterInfo[] parameterInfoArray, bool throwOnError)
1453
Expression
expression = source[i];
1488
Expression
expression = methodCallExpression.Arguments[0];
1546
Expression
expression = methodCallExpression.Arguments[0];
System\Activities\Expressions\ITextExpression.cs (1)
26
Expression
GetExpressionTree();
System\Activities\Expressions\LambdaReference.cs (2)
36
internal
Expression
LambdaExpression
49
Expression
newTree;
System\Activities\Expressions\LambdaValue.cs (2)
36
internal
Expression
LambdaExpression
49
Expression
newTree;
System\Activities\Expressions\MemberExpressionHelper.cs (4)
38
ParameterExpression operandParameter =
Expression
.Parameter(typeof(TOperand), "operand");
42
memberExpression =
Expression
.MakeMemberAccess(null, GetMemberInfo<TOperand>(memberName, isField));
46
memberExpression =
Expression
.MakeMemberAccess(operandParameter, GetMemberInfo<TOperand>(memberName, isField));
48
Expression<Func<TOperand, TResult>> lambdaExpression =
Expression
.Lambda<Func<TOperand, TResult>>(memberExpression, operandParameter);
System\Activities\Expressions\MethodCallExpressionHelper.cs (69)
21
Collection<
Expression
> assignVariablesExpressions, Collection<
Expression
> assignVariablesBackExpressions)
30
ParameterExpression variable =
Expression
.Parameter(parameterType.IsByRef ? parameterType.GetElementType() : parameterType, "arg" + i);
34
assignVariablesExpressions.Add(
Expression
.Assign(variable,
35
Expression
.Convert(
36
Expression
.Call(typeof(Convert).GetMethod("ChangeType", new Type[] { typeof(object), typeof(Type) }),
Expression
.ArrayIndex(objectArray,
Expression
.Constant(i)),
Expression
.Constant(variable.Type, typeof(Type))),
41
assignVariablesExpressions.Add(
Expression
.Assign(variable,
42
Expression
.Convert(
Expression
.ArrayIndex(objectArray,
Expression
.Constant(i)), variable.Type)));
48
assignVariablesBackExpressions.Add(
Expression
.Assign(
Expression
.ArrayAccess(objectArray,
Expression
.Constant(i)),
49
Expression
.Convert(variable, typeof(object))));
53
assignVariablesBackExpressions.Add(
Expression
.Assign(
Expression
.ArrayAccess(objectArray,
Expression
.Constant(i)),
67
callExpression =
Expression
.Call(
Expression
.Convert(targetInstance, methodInfo.DeclaringType), methodInfo, variables);
71
callExpression =
Expression
.Call(methodInfo, variables);
77
Collection<ParameterExpression> variables, out ParameterExpression tempInstance, out
Expression
assignTempInstanceExpression)
86
tempInstance =
Expression
.Parameter(methodInfo.DeclaringType, "tempInstance");
87
assignTempInstanceExpression =
Expression
.Assign(tempInstance,
Expression
.Convert(targetInstance, methodInfo.DeclaringType));
88
callExpression =
Expression
.Call(tempInstance,
93
callExpression =
Expression
.Call(
Expression
.Convert(targetInstance, methodInfo.DeclaringType), methodInfo, variables);
98
callExpression =
Expression
.Call(methodInfo, variables);
103
static
Expression
ComposeBlockExpression(Collection<ParameterExpression> variables, Collection<
Expression
> assignVariables,
Expression
callExpression,
104
Collection<
Expression
> assignVariablesBack, Type returnType, bool isConstructor, bool valueTypeReference)
106
Collection<
Expression
> expressions = new Collection<
Expression
>();
107
foreach (
Expression
expression in assignVariables)
112
ParameterExpression result =
Expression
.Parameter(isConstructor ? returnType : typeof(object), "result");
116
Expression
resultAssign = null;
119
resultAssign =
Expression
.Assign(result,
120
Expression
.Convert(callExpression, typeof(object)));
124
resultAssign =
Expression
.Assign(result, callExpression);
132
foreach (
Expression
expression in assignVariablesBack)
142
Expression
block =
Expression
.Block(variables, expressions);
146
static
Expression
ComposeLinqExpression(MethodInfo methodInfo, ParameterExpression targetInstance, ParameterExpression objectArray, Type returnType, bool valueTypeReference)
148
Collection<
Expression
> assignVariablesExpressions = new Collection<
Expression
>();
149
Collection<
Expression
> assignVariablesBackExpressions = new Collection<
Expression
>();
155
Expression
assignTempInstanceExpression = null;
156
Expression
expression;
163
assignVariablesBackExpressions.Add(
Expression
.Assign(targetInstance,
Expression
.Convert(tempInstance, typeof(object))));
175
static
Expression
ComposeLinqExpression<TResult>(ConstructorInfo constructorInfo, ParameterExpression objectArray)
177
Collection<
Expression
> assignVariablesExpressions = new Collection<
Expression
>();
178
Collection<
Expression
> assignVariablesBackExpressions = new Collection<
Expression
>();
186
newExpression =
Expression
.New(constructorInfo, variables);
190
newExpression =
Expression
.New(typeof(TResult));
199
ParameterExpression targetInstance =
Expression
.Parameter(typeof(object), "targetInstance");
200
ParameterExpression objectArray =
Expression
.Parameter(typeof(object[]), "arguments");
201
Expression
block = ComposeLinqExpression(methodInfo, targetInstance, objectArray, methodInfo.ReturnType, valueTypeReference);
202
Expression<Func<object, object[], object>> lambdaExpression =
Expression
.Lambda<Func<object, object[], object>>(block, targetInstance, objectArray);
221
ParameterExpression objectArray =
Expression
.Parameter(typeof(object[]), "arguments");
222
Expression
block = ComposeLinqExpression<TResult>(constructorInfo, objectArray);
223
Expression<Func<object[], TResult>> lambdaExpression =
Expression
.Lambda<Func<object[], TResult>>(block, objectArray);
System\Activities\Expressions\OperatorPermissionHelper.cs (6)
29
internal static
Expression
InjectReflectionPermissionIfNecessary(MethodInfo method,
Expression
expression)
43
Expression
demandExpression =
Expression
.Call(
Expression
.Constant(reflectionMemberAccessPermission), "Demand", null, null);
44
return
Expression
.Block(expression.Type, demandExpression, expression);
System\Activities\Expressions\UnaryExpressionHelper.cs (4)
31
ParameterExpression operandParameter =
Expression
.Parameter(typeof(TOperand), "operand");
34
UnaryExpression unaryExpression =
Expression
.MakeUnary(operatorType, operandParameter, typeof(TResult));
35
Expression
expressionToCompile = OperatorPermissionHelper.InjectReflectionPermissionIfNecessary(unaryExpression.Method, unaryExpression);
36
Expression<Func<TOperand, TResult>> lambdaExpression =
Expression
.Lambda<Func<TOperand, TResult>>(expressionToCompile, operandParameter);
System\Activities\ExpressionUtilities.cs (96)
21
public static ParameterExpression RuntimeContextParameter =
Expression
.Parameter(typeof(ActivityContext), "context");
62
public static
Expression
CreateIdentifierExpression(LocationReference locationReference)
64
return
Expression
.Call(RuntimeContextParameter, activityContextGetValueGenericMethod.MakeGenericMethod(locationReference.Type),
Expression
.Constant(locationReference, typeof(LocationReference)));
73
Expression
body = expression.Body;
159
Expression
body = expression.Body;
234
static LocationFactory CreateParentReference(
Expression
expression, ReadOnlyCollection<ParameterExpression> lambdaParameters)
247
LambdaExpression parentLambda =
Expression
.Lambda(funcType, expression, lambdaParameters);
254
static Func<ActivityContext, T> Compile<T>(
Expression
objectExpression, ReadOnlyCollection<ParameterExpression> parametersCollection)
262
Expression<Func<ActivityContext, T>> objectLambda =
Expression
.Lambda<Func<ActivityContext, T>>(objectExpression, parameters);
266
static T Evaluate<T>(
Expression
objectExpression, ReadOnlyCollection<ParameterExpression> parametersCollection, ActivityContext context)
355
Expression
.Convert(memberExpression.Expression, TypeHelper.ObjectType), expression.Parameters);
456
public ArgumentFactory(
Expression
argumentExpression, ReadOnlyCollection<ParameterExpression> expressionParameters)
473
public LocationReferenceFactory(
Expression
locationReferenceExpression, ReadOnlyCollection<ParameterExpression> expressionParameters)
527
Expression
argument = callExpression.Arguments[i];
530
argument =
Expression
.Convert(argument, TypeHelper.ObjectType);
751
Expression
.Convert(memberExpression.Expression, TypeHelper.ObjectType), expression.Parameters);
876
public static bool TryRewriteLambdaExpression(
Expression
expression, out
Expression
newExpression, CodeActivityPublicEnvironmentAccessor publicAccessor, bool isLocationExpression = false)
886
Expression
left = null;
887
Expression
right = null;
888
Expression
other = null;
890
IList<
Expression
> expressionList = null;
931
newExpression =
Expression
.MakeBinary(
950
newExpression =
Expression
.Condition(
968
newExpression =
Expression
.Invoke(
981
newExpression =
Expression
.Lambda(
996
newExpression =
Expression
.ListInit(
1016
newExpression =
Expression
.MakeMemberAccess(
1030
newExpression =
Expression
.MemberInit(
1046
newExpression =
Expression
.ArrayIndex(
1060
newExpression =
Expression
.ArrayIndex(
1081
newExpression =
Expression
.NewArrayInit(
1094
newExpression =
Expression
.NewArrayBounds(
1126
newExpression =
Expression
.TypeIs(
1146
newExpression =
Expression
.MakeUnary(
1161
newExpression =
Expression
.UnaryPlus(
1177
newExpression =
Expression
.Block(block.Variables, expressionList);
1189
newExpression =
Expression
.Assign(left, right);
1246
Expression
other = null;
1259
newBinding =
Expression
.Bind(assignment.Member, other);
1270
newBinding =
Expression
.ListBind(list.Member, initializerList);
1281
newBinding =
Expression
.MemberBind(member.Member, bindingList);
1290
static bool TryRewriteLambdaExpressionCollection(IList<
Expression
> expressions, out IList<
Expression
> newExpressions, CodeActivityPublicEnvironmentAccessor publicAccessor)
1292
IList<
Expression
> temporaryExpressions = null;
1296
Expression
expression = expressions[i];
1298
Expression
newExpression;
1305
temporaryExpressions = new List<
Expression
>(expressions.Count);
1342
IList<
Expression
> newExpressions;
1357
elementInit =
Expression
.ElementInit(elementInit.AddMethod, newExpressions);
1378
static bool TryGetInlinedArgumentReference(MethodCallExpression originalExpression,
Expression
argumentExpression, out LocationReference inlinedReference, CodeActivityPublicEnvironmentAccessor publicAccessor, bool isLocationExpression)
1393
Expression<Func<Argument>> argumentLambda =
Expression
.Lambda<Func<Argument>>(argumentExpression);
1442
static bool TryRewriteArgumentGetCall(MethodCallExpression originalExpression, Type returnType, out
Expression
newExpression, CodeActivityPublicEnvironmentAccessor publicAccessor, bool isLocationExpression)
1447
ReadOnlyCollection<
Expression
> argumentExpressions = originalExpression.Arguments;
1451
Expression
contextExpression = argumentExpressions[0];
1458
newExpression =
Expression
.Call(contextExpression, activityContextGetValueGenericMethod.MakeGenericMethod(returnType),
Expression
.Constant(inlinedReference, typeof(LocationReference)));
1468
static bool TryRewriteArgumentGetLocationCall(MethodCallExpression originalExpression, Type returnType, out
Expression
newExpression, CodeActivityPublicEnvironmentAccessor publicAccessor)
1473
ReadOnlyCollection<
Expression
> argumentExpressions = originalExpression.Arguments;
1477
Expression
contextExpression = argumentExpressions[0];
1486
newExpression =
Expression
.Call(
Expression
.Constant(inlinedReference, typeof(LocationReference)), locationReferenceGetLocationMethod, contextExpression);
1490
newExpression =
Expression
.Call(contextExpression, activityContextGetLocationGenericMethod.MakeGenericMethod(returnType),
Expression
.Constant(inlinedReference, typeof(LocationReference)));
1502
static bool TryRewriteLocationReferenceSubclassGetCall(MethodCallExpression originalExpression, Type returnType, out
Expression
newExpression, CodeActivityPublicEnvironmentAccessor publicAccessor, bool isLocationExpression)
1507
ReadOnlyCollection<
Expression
> argumentExpressions = originalExpression.Arguments;
1511
Expression
contextExpression = argumentExpressions[0];
1518
newExpression =
Expression
.Call(contextExpression, activityContextGetValueGenericMethod.MakeGenericMethod(returnType),
Expression
.Constant(inlinedReference, typeof(LocationReference)));
1528
static bool TryRewriteLocationReferenceSubclassGetLocationCall(MethodCallExpression originalExpression, Type returnType, out
Expression
newExpression, CodeActivityPublicEnvironmentAccessor publicAccessor)
1533
ReadOnlyCollection<
Expression
> argumentExpressions = originalExpression.Arguments;
1537
Expression
contextExpression = argumentExpressions[0];
1546
newExpression =
Expression
.Call(
Expression
.Constant(inlinedReference, typeof(LocationReference)), locationReferenceGetLocationMethod, originalExpression.Arguments[0]);
1550
newExpression =
Expression
.Call(contextExpression, activityContextGetLocationGenericMethod.MakeGenericMethod(returnType),
Expression
.Constant(inlinedReference, typeof(LocationReference)));
1562
static bool CustomMemberResolver(
Expression
expression, out object memberValue)
1616
static bool TryGetInlinedLocationReference(MethodCallExpression originalExpression,
Expression
locationReferenceExpression, out LocationReference inlinedReference, CodeActivityPublicEnvironmentAccessor publicAccessor, bool isLocationExpression)
1630
Expression<Func<LocationReference>> locationReferenceLambda =
Expression
.Lambda<Func<LocationReference>>(locationReferenceExpression);
1662
static bool TryRewriteActivityContextGetValueCall(MethodCallExpression originalExpression, Type returnType, out
Expression
newExpression, CodeActivityPublicEnvironmentAccessor publicAccessor, bool isLocationExpression)
1671
ReadOnlyCollection<
Expression
> argumentExpressions = originalExpression.Arguments;
1675
Expression
parameterExpression = argumentExpressions[0];
1697
newExpression =
Expression
.Call(originalExpression.Object, activityContextGetValueGenericMethod.MakeGenericMethod(returnType),
Expression
.Constant(inlinedReference, typeof(LocationReference)));
1704
static bool TryRewriteActivityContextGetLocationCall(MethodCallExpression originalExpression, Type returnType, out
Expression
newExpression, CodeActivityPublicEnvironmentAccessor publicAccessor)
1709
ReadOnlyCollection<
Expression
> argumentExpressions = originalExpression.Arguments;
1713
Expression
locationReference = argumentExpressions[0];
1720
newExpression =
Expression
.Call(originalExpression.Object, activityContextGetLocationGenericMethod.MakeGenericMethod(returnType),
Expression
.Constant(inlinedReference, typeof(LocationReference)));
1736
static bool TryRewriteMethodCall(MethodCallExpression methodCall, out
Expression
newExpression, CodeActivityPublicEnvironmentAccessor publicAccessor, bool isLocationExpression)
1962
Expression
objectExpression;
1963
IList<
Expression
> expressionList;
1970
newExpression =
Expression
.Call(objectExpression, targetMethod, expressionList);
1976
internal static
Expression
RewriteNonCompiledExpressionTree(LambdaExpression originalLambdaExpression)
1979
return expressionVisitor.Visit(
Expression
.Lambda(
System\Activities\XamlIntegration\CompiledDataContext.cs (3)
63
protected
Expression
RewriteExpressionTree(
Expression
originalExpression)
77
return this.visitor.Visit(
Expression
.Lambda(
System\Activities\XamlIntegration\ExpressionTreeRewriter.cs (6)
25
protected override
Expression
VisitMember(MemberExpression node)
27
Expression
newNode = null;
41
protected override
Expression
VisitConstant(ConstantExpression node)
45
Expression
newNode = node;
49
newNode =
Expression
.Constant(inlinedReference.LocationReference, typeof(LocationReference));
57
bool TryRewriteMemberExpressionNode(MemberExpression node, out
Expression
newNode)
System\Activities\XamlIntegration\ICompiledExpressionRoot.cs (1)
27
Expression
GetExpressionTreeForExpression(int expressionId, IList<LocationReference> locationReferences);
System\Activities\XamlIntegration\TextExpressionCompiler.cs (2)
884
getExpressionTreeForExpressionMethod.ReturnType = new CodeTypeReference(typeof(
Expression
));
1478
expressionMethod.ReturnType = new CodeTypeReference(typeof(
Expression
));
System.Activities.Presentation (14)
System.Activities.Presentation\System\Activities\Presentation\Model\ModelItemImpl.cs (14)
465
DynamicMetaObject IDynamicMetaObjectProvider.GetMetaObject(System.Linq.Expressions.
Expression
parameter)
529
public ModelItemMetaObject(System.Linq.Expressions.
Expression
parameter, ModelItemImpl target)
536
System.Linq.Expressions.
Expression
s = System.Linq.Expressions.
Expression
.Convert(this.Expression, typeof(ModelItemImpl));
537
System.Linq.Expressions.
Expression
value = System.Linq.Expressions.
Expression
.Call(s, getPropertyValueMethodInfo, System.Linq.Expressions.
Expression
.Constant(binder.Name));
543
System.Linq.Expressions.
Expression
s = System.Linq.Expressions.
Expression
.Convert(this.Expression, typeof(ModelItemImpl));
544
System.Linq.Expressions.
Expression
objectValue = System.Linq.Expressions.
Expression
.Convert(value.Expression, typeof(object));
545
System.Linq.Expressions.
Expression
valueExp = System.Linq.Expressions.
Expression
.Call(s, setPropertyValueMethodInfo, System.Linq.Expressions.
Expression
.Constant(binder.Name), objectValue);
System.Core (2791)
Microsoft\Scripting\Actions\BindingRestrictions.cs (39)
41
public static readonly BindingRestrictions Empty = new CustomRestriction(
Expression
.Constant(true));
51
internal abstract
Expression
GetExpression();
75
public static BindingRestrictions GetTypeRestriction(
Expression
expression, Type type) {
100
public static BindingRestrictions GetInstanceRestriction(
Expression
expression, object instance) {
115
public static BindingRestrictions GetExpressionRestriction(
Expression
expression) {
149
internal
Expression
Node;
161
internal
Expression
ToExpression() {
162
Expression
result = _tests.Pop().Node;
164
result =
Expression
.AndAlso(_tests.Pop().Node, result);
169
private void Push(
Expression
node, int depth) {
171
node =
Expression
.AndAlso(_tests.Pop().Node, node);
179
/// Creates the <see cref="
Expression
"/> representing the binding restrictions.
182
public
Expression
ToExpression() {
187
return
Expression
.Constant(true);
221
internal override
Expression
GetExpression() {
227
private readonly
Expression
_expression;
229
internal CustomRestriction(
Expression
expression) {
242
internal override
Expression
GetExpression() {
248
private readonly
Expression
_expression;
251
internal TypeRestriction(
Expression
parameter, Type type) {
265
internal override
Expression
GetExpression() {
266
return
Expression
.TypeEqual(_expression, _type);
271
private readonly
Expression
_expression;
274
internal InstanceRestriction(
Expression
parameter, object instance) {
288
internal override
Expression
GetExpression() {
290
return
Expression
.Equal(
291
Expression
.Convert(_expression, typeof(object)),
292
Expression
.Constant(null)
296
ParameterExpression temp =
Expression
.Parameter(typeof(object), null);
297
return
Expression
.Block(
299
Expression
.Assign(
301
Expression
.Property(
302
Expression
.Constant(new WeakReference(_instance)),
306
Expression
.AndAlso(
308
Expression
.NotEqual(temp,
Expression
.Constant(null)),
309
Expression
.Equal(
310
Expression
.Convert(_expression, typeof(object)),
333
public
Expression
Test {
Microsoft\Scripting\Actions\CallSite.cs (124)
338
var @params = invoke.GetParametersCached().Map(p =>
Expression
.Parameter(p.ParameterType, p.Name));
339
return
Expression
.Lambda<T>(
340
Expression
.Block(
341
Expression
.Call(
345
Expression
.Default(invoke.GetReturnType())
359
var body = new List<
Expression
>();
361
var @params = invoke.GetParametersCached().Map(p =>
Expression
.Parameter(p.ParameterType, p.Name));
362
var @return =
Expression
.Label(invoke.GetReturnType());
369
var @this =
Expression
.Variable(typeof(CallSite<T>), "this");
371
body.Add(
Expression
.Assign(@this,
Expression
.Convert(site, @this.Type)));
374
var applicable =
Expression
.Variable(typeof(T[]), "applicable");
378
var rule =
Expression
.Variable(typeof(T), "rule");
381
var originalRule =
Expression
.Variable(typeof(T), "originalRule");
383
body.Add(
Expression
.Assign(originalRule,
Expression
.Field(@this, "Target")));
388
vars.Add(result =
Expression
.Variable(@return.Type, "result"));
392
var count =
Expression
.Variable(typeof(int), "count");
394
var index =
Expression
.Variable(typeof(int), "index");
402
Expression
.Assign(
404
Expression
.Call(
437
Expression
invokeRule;
439
Expression
getMatch =
Expression
.Call(
444
Expression
resetMatch =
Expression
.Call(
449
var onMatch =
Expression
.Call(
458
invokeRule =
Expression
.Block(
459
Expression
.Invoke(rule, new TrueReadOnlyCollection<
Expression
>(@params)),
460
Expression
.IfThen(
462
Expression
.Block(onMatch,
Expression
.Return(@return))
466
invokeRule =
Expression
.Block(
467
Expression
.Assign(result,
Expression
.Invoke(rule, new TrueReadOnlyCollection<
Expression
>(@params))),
468
Expression
.IfThen(
470
Expression
.Block(onMatch,
Expression
.Return(@return, result))
475
Expression
getRule =
Expression
.Assign(rule,
Expression
.ArrayAccess(applicable, index));
477
var @break =
Expression
.Label();
479
var breakIfDone =
Expression
.IfThen(
480
Expression
.Equal(index, count),
481
Expression
.Break(@break)
484
var incrementIndex =
Expression
.PreIncrementAssign(index);
487
Expression
.IfThen(
488
Expression
.NotEqual(
489
Expression
.Assign(applicable,
Expression
.Call(typeof(CallSiteOps), "GetRules", typeArgs, @this)),
490
Expression
.Constant(null, applicable.Type)
492
Expression
.Block(
493
Expression
.Assign(count,
Expression
.ArrayLength(applicable)),
494
Expression
.Assign(index,
Expression
.Constant(0)),
495
Expression
.Loop(
496
Expression
.Block(
499
Expression
.IfThen(
500
Expression
.NotEqual(
501
Expression
.Convert(rule, typeof(object)),
502
Expression
.Convert(originalRule, typeof(object))
504
Expression
.Block(
505
Expression
.Assign(
506
Expression
.Field(@this, "Target"),
532
var cache =
Expression
.Variable(typeof(RuleCache<T>), "cache");
536
Expression
.Assign(
538
Expression
.Call(typeof(CallSiteOps), "GetRuleCache", typeArgs, @this)
545
Expression
.Assign(
547
Expression
.Call(typeof(CallSiteOps), "GetCachedRules", typeArgs, cache)
583
invokeRule =
Expression
.Block(
584
Expression
.Invoke(rule, new TrueReadOnlyCollection<
Expression
>(@params)),
585
Expression
.IfThen(
587
Expression
.Return(@return)
591
invokeRule =
Expression
.Block(
592
Expression
.Assign(result,
Expression
.Invoke(rule, new TrueReadOnlyCollection<
Expression
>(@params))),
593
Expression
.IfThen(
595
Expression
.Return(@return, result)
600
var tryRule =
Expression
.TryFinally(
602
Expression
.IfThen(
604
Expression
.Block(
605
Expression
.Call(typeof(CallSiteOps), "AddRule", typeArgs, @this, rule),
606
Expression
.Call(typeof(CallSiteOps), "MoveRule", typeArgs, cache, rule, index)
611
getRule =
Expression
.Assign(
612
Expression
.Field(@this, "Target"),
613
Expression
.Assign(rule,
Expression
.ArrayAccess(applicable, index))
616
body.Add(
Expression
.Assign(index,
Expression
.Constant(0)));
617
body.Add(
Expression
.Assign(count,
Expression
.ArrayLength(applicable)));
619
Expression
.Loop(
620
Expression
.Block(
637
body.Add(
Expression
.Assign(rule,
Expression
.Constant(null, rule.Type)));
640
var args =
Expression
.Variable(typeof(object[]), "args");
643
Expression
.Assign(
645
Expression
.NewArrayInit(typeof(object), arguments.Map(p => Convert(p, typeof(object))))
675
Expression
setOldTarget =
Expression
.Assign(
676
Expression
.Field(@this, "Target"),
680
getRule =
Expression
.Assign(
681
Expression
.Field(@this, "Target"),
682
Expression
.Assign(
684
Expression
.Call(
688
Expression
.Property(@this, "Binder"),
695
tryRule =
Expression
.TryFinally(
697
Expression
.IfThen(
699
Expression
.Call(typeof(CallSiteOps), "AddRule", typeArgs, @this, rule)
704
Expression
.Loop(
705
Expression
.Block(setOldTarget, getRule, tryRule, resetMatch),
710
body.Add(
Expression
.Default(@return.Type));
712
var lambda =
Expression
.Lambda<T>(
713
Expression
.Label(
715
Expression
.Block(
717
new ReadOnlyCollection<
Expression
>(body)
730
private static
Expression
Convert(
Expression
arg, Type type) {
734
return
Expression
.Convert(arg, type);
Microsoft\Scripting\Actions\CallSiteBinder.cs (20)
38
private static readonly LabelTarget _updateLabel =
Expression
.Label("CallSiteBinder.UpdateLabel");
81
@params[i] =
Expression
.Parameter(pis[i + 1].ParameterType, "$arg" + i);
85
ReturnLabel =
Expression
.Label(invoke.GetReturnType());
99
/// to produce a new <see cref="
Expression
"/> for the new argument types.
101
public abstract
Expression
Bind(object[] args, ReadOnlyCollection<ParameterExpression> parameters, LabelTarget returnLabel);
130
Expression
binding = Bind(args, signature.Parameters, signature.ReturnLabel);
168
private static Expression<T> Stitch<T>(
Expression
binding, LambdaSignature<T> signature) where T : class {
171
var body = new ReadOnlyCollectionBuilder<
Expression
>(3);
174
var site =
Expression
.Parameter(typeof(CallSite), "$site");
177
Expression
updLabel =
Expression
.Label(CallSiteBinder.UpdateLabel);
189
Expression
.Label(
191
Expression
.Condition(
192
Expression
.Call(
196
Expression
.Default(signature.ReturnLabel.Type),
197
Expression
.Invoke(
198
Expression
.Property(
199
Expression
.Convert(site, siteType),
202
new TrueReadOnlyCollection<
Expression
>(@params)
209
Expression
.Block(body),
Microsoft\Scripting\Actions\DynamicMetaObject.cs (9)
37
private readonly
Expression
_expression;
53
public DynamicMetaObject(
Expression
expression, BindingRestrictions restrictions) {
67
public DynamicMetaObject(
Expression
expression, BindingRestrictions restrictions, object value)
76
public
Expression
Expression {
285
internal static
Expression
[] GetExpressions(DynamicMetaObject[] objects) {
288
Expression
[] res = new
Expression
[objects.Length];
292
Expression
expr = mo.Expression;
310
public static DynamicMetaObject Create(object value,
Expression
expression) {
Microsoft\Scripting\Actions\DynamicMetaObjectBinder.cs (18)
71
/// to produce a new <see cref="
Expression
"/> for the new argument types.
73
public sealed override
Expression
Bind(object[] args, ReadOnlyCollection<ParameterExpression> parameters, LabelTarget returnLabel) {
113
Expression
body = binding.Expression;
144
body =
Expression
.Return(returnLabel, body);
149
body =
Expression
.IfThen(restrictions.ToExpression(), body);
182
Expression
.AndAlso(
183
Expression
.NotEqual(expr,
Expression
.Constant(null)),
184
Expression
.Call(
192
Expression
.AndAlso(
193
Expression
.NotEqual(expr,
Expression
.Constant(null)),
194
Expression
.Not(
195
Expression
.Call(
225
/// <param name="type">The <see cref="
Expression
.Type">Type</see> property of the resulting expression; any type is allowed.</param>
228
public
Expression
GetUpdateExpression(Type type) {
229
return
Expression
.Goto(CallSiteBinder.UpdateLabel, type);
268
DynamicExpression.Make(ReturnType, delegateType, this, new TrueReadOnlyCollection<
Expression
>(exprs)),
Microsoft\Scripting\Actions\DynamicObject.cs (84)
230
internal MetaDynamic(
Expression
expression, DynamicObject value)
365
private readonly static
Expression
[] NoArgs = new
Expression
[0];
367
private static
Expression
[] GetConvertedArgs(params
Expression
[] args) {
368
ReadOnlyCollectionBuilder<
Expression
> paramArgs = new ReadOnlyCollectionBuilder<
Expression
>(args.Length);
371
paramArgs.Add(
Expression
.Convert(args[i], typeof(object)));
381
private static
Expression
ReferenceArgAssign(
Expression
callArgs,
Expression
[] args) {
382
ReadOnlyCollectionBuilder<
Expression
> block = null;
388
block = new ReadOnlyCollectionBuilder<
Expression
>();
391
Expression
.Assign(
393
Expression
.Convert(
394
Expression
.ArrayIndex(
396
Expression
.Constant(i)
406
return
Expression
.Block(block);
408
return
Expression
.Empty();
417
private static
Expression
[] BuildCallArgs(DynamicMetaObjectBinder binder,
Expression
[] parameters,
Expression
arg0,
Expression
arg1) {
419
return arg1 != null ? new
Expression
[] { Constant(binder), arg0, arg1 } : new
Expression
[] { Constant(binder), arg0 };
421
return arg1 != null ? new
Expression
[] { Constant(binder), arg1 } : new
Expression
[] { Constant(binder) };
429
return
Expression
.Constant(binder, t);
436
private DynamicMetaObject CallMethodWithResult(string methodName, DynamicMetaObjectBinder binder,
Expression
[] args, Fallback fallback) {
444
private DynamicMetaObject CallMethodWithResult(string methodName, DynamicMetaObjectBinder binder,
Expression
[] args, Fallback fallback, Fallback fallbackInvoke) {
472
private DynamicMetaObject BuildCallMethodWithResult(string methodName, DynamicMetaObjectBinder binder,
Expression
[] args, DynamicMetaObject fallbackResult, Fallback fallbackInvoke) {
484
var result =
Expression
.Parameter(typeof(object), null);
485
ParameterExpression callArgs = methodName != "TryBinaryOperation" ?
Expression
.Parameter(typeof(object[]), null) :
Expression
.Parameter(typeof(object), null);
494
var convert =
Expression
.Convert(resultMO.Expression, binder.ReturnType);
507
Expression
condition;
510
condition =
Expression
.TypeIs(resultMO.Expression, binder.ReturnType);
513
condition =
Expression
.OrElse(
514
Expression
.Equal(resultMO.Expression,
Expression
.Constant(null)),
515
Expression
.TypeIs(resultMO.Expression, binder.ReturnType));
518
var checkedConvert =
Expression
.Condition(
521
Expression
.Throw(
522
Expression
.New(typeof(InvalidCastException).GetConstructor(new Type[]{typeof(string)}),
523
Expression
.Call(
525
Expression
.Constant(convertFailed),
526
Expression
.NewArrayInit(typeof(object),
527
Expression
.Condition(
528
Expression
.Equal(resultMO.Expression,
Expression
.Constant(null)),
529
Expression
.Constant("null"),
530
Expression
.Call(
555
Expression
.Block(
557
methodName != "TryBinaryOperation" ?
Expression
.Assign(callArgs,
Expression
.NewArrayInit(typeof(object), callArgsValue)) :
Expression
.Assign(callArgs, callArgsValue[0]),
558
Expression
.Condition(
559
Expression
.Call(
569
Expression
.Block(
570
methodName != "TryBinaryOperation" ? ReferenceArgAssign(callArgs, args) :
Expression
.Empty(),
592
private DynamicMetaObject CallMethodReturnLast(string methodName, DynamicMetaObjectBinder binder,
Expression
[] args,
Expression
value, Fallback fallback) {
607
var result =
Expression
.Parameter(typeof(object), null);
608
var callArgs =
Expression
.Parameter(typeof(object[]), null);
612
Expression
.Block(
614
Expression
.Assign(callArgs,
Expression
.NewArrayInit(typeof(object), callArgsValue)),
615
Expression
.Condition(
616
Expression
.Call(
623
Expression
.Assign(result,
Expression
.Convert(value, typeof(object)))
626
Expression
.Block(
658
private DynamicMetaObject CallMethodNoResult(string methodName, DynamicMetaObjectBinder binder,
Expression
[] args, Fallback fallback) {
664
var callArgs =
Expression
.Parameter(typeof(object[]), null);
672
Expression
.Block(
674
Expression
.Assign(callArgs,
Expression
.NewArrayInit(typeof(object), callArgsValue)),
675
Expression
.Condition(
676
Expression
.Call(
686
Expression
.Block(
688
Expression
.Empty()
738
private
Expression
GetLimitedSelf() {
744
return
Expression
.Convert(Expression, typeof(DynamicObject));
777
public virtual DynamicMetaObject GetMetaObject(
Expression
parameter) {
Microsoft\Scripting\Actions\ExpandoObject.cs (35)
270
DynamicMetaObject IDynamicMetaObjectProvider.GetMetaObject(
Expression
parameter) {
687
public MetaExpando(
Expression
expression, ExpandoObject value)
697
ParameterExpression value =
Expression
.Parameter(typeof(object), "value");
699
Expression
tryGetValue =
Expression
.Call(
702
Expression
.Constant(klass, typeof(object)),
703
Expression
.Constant(index),
704
Expression
.Constant(name),
705
Expression
.Constant(ignoreCase),
715
Expression
.Block(
717
Expression
.Condition(
766
Expression
.Call(
769
Expression
.Constant(klass, typeof(object)),
770
Expression
.Constant(index),
771
Expression
.Convert(value.Expression, typeof(object)),
772
Expression
.Constant(binder.Name),
773
Expression
.Constant(binder.IgnoreCase)
785
Expression
tryDelete =
Expression
.Call(
788
Expression
.Constant(Value.Class, typeof(object)),
789
Expression
.Constant(index),
790
Expression
.Constant(binder.Name),
791
Expression
.Constant(binder.IgnoreCase)
796
Expression
.IfThen(
Expression
.Not(tryDelete), fallback.Expression),
820
Expression
ifTestSucceeds = succeeds.Expression;
828
ifTestSucceeds =
Expression
.Block(
829
Expression
.Call(
833
Expression
.Constant(originalClass, typeof(object)),
834
Expression
.Constant(klass, typeof(object))
841
Expression
.Condition(
842
Expression
.Call(
846
Expression
.Constant(originalClass ?? klass, typeof(object))
886
private
Expression
GetLimitedSelf() {
890
return
Expression
.Convert(Expression, LimitType);
Microsoft\Scripting\Actions\IDynamicMetaObjectProvider.cs (1)
36
DynamicMetaObject GetMetaObject(
Expression
parameter);
Microsoft\Scripting\Ast\BinaryExpression.cs (454)
37
[DebuggerTypeProxy(typeof(
Expression
.BinaryExpressionProxy))]
40
private readonly
Expression
_left;
41
private readonly
Expression
_right;
43
internal BinaryExpression(
Expression
left,
Expression
right) {
82
public
Expression
Right {
89
public
Expression
Left {
118
public BinaryExpression Update(
Expression
left, LambdaExpression conversion,
Expression
right) {
124
return
Expression
.ReferenceEqual(left, right);
126
return
Expression
.ReferenceNotEqual(left, right);
129
return
Expression
.MakeBinary(NodeType, left, right, IsLiftedToNull, Method, conversion);
139
public override
Expression
Reduce() {
195
private
Expression
ReduceVariable() {
200
Expression
r =
Expression
.MakeBinary(op, _left, _right, false, Method);
203
r =
Expression
.Invoke(conversion, r);
205
return
Expression
.Assign(_left, r);
208
private
Expression
ReduceMember() {
224
Expression
e1 =
Expression
.Assign(temp1, member.Expression);
228
Expression
e2 =
Expression
.MakeBinary(op,
Expression
.MakeMemberAccess(temp1, member.Member), _right, false, Method);
231
e2 =
Expression
.Invoke(conversion, e2);
234
e2 =
Expression
.Assign(temp2, e2);
237
Expression
e3 =
Expression
.Assign(
Expression
.MakeMemberAccess(temp1, member.Member), temp2);
240
Expression
e4 = temp2;
242
return
Expression
.Block(
249
private
Expression
ReduceIndex() {
264
var exprs = new List<
Expression
>(index.Arguments.Count + 3);
266
var tempObj =
Expression
.Variable(index.Object.Type, "tempObj");
268
exprs.Add(
Expression
.Assign(tempObj, index.Object));
270
var tempArgs = new List<
Expression
>(index.Arguments.Count);
271
foreach (
var
arg in index.Arguments) {
272
var tempArg =
Expression
.Variable(arg.Type, "tempArg" + tempArgs.Count);
275
exprs.Add(
Expression
.Assign(tempArg, arg));
278
var tempIndex =
Expression
.MakeIndex(tempObj, index.Indexer, tempArgs);
282
Expression
op =
Expression
.MakeBinary(binaryOp, tempIndex, _right, false, Method);
285
op =
Expression
.Invoke(conversion, op);
287
var tempValue =
Expression
.Variable(op.Type, "tempValue");
289
exprs.Add(
Expression
.Assign(tempValue, op));
292
exprs.Add(
Expression
.Assign(tempIndex, tempValue));
294
return
Expression
.Block(vars, exprs);
336
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
340
internal static
Expression
Create(ExpressionType nodeType,
Expression
left,
Expression
right, Type type, MethodInfo method, LambdaExpression conversion) {
415
internal
Expression
ReduceUserdefinedLifted() {
460
internal LogicalBinaryExpression(ExpressionType nodeType,
Expression
left,
Expression
right)
476
internal AssignBinaryExpression(
Expression
left,
Expression
right)
495
internal CoalesceConversionBinaryExpression(
Expression
left,
Expression
right, LambdaExpression conversion)
519
internal OpAssignMethodConversionBinaryExpression(ExpressionType nodeType,
Expression
left,
Expression
right, Type type, MethodInfo method, LambdaExpression conversion)
535
internal SimpleBinaryExpression(ExpressionType nodeType,
Expression
left,
Expression
right, Type type)
555
internal MethodBinaryExpression(ExpressionType nodeType,
Expression
left,
Expression
right, Type type, MethodInfo method)
572
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
573
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
577
public static BinaryExpression Assign(
Expression
left,
Expression
right) {
591
private static BinaryExpression GetUserDefinedBinaryOperator(ExpressionType binaryType, string name,
Expression
left,
Expression
right, bool liftToNull) {
614
private static BinaryExpression GetMethodBasedBinaryOperator(ExpressionType binaryType,
Expression
left,
Expression
right, MethodInfo method, bool liftToNull) {
640
private static BinaryExpression GetMethodBasedAssignOperator(ExpressionType binaryType,
Expression
left,
Expression
right, MethodInfo method, LambdaExpression conversion, bool liftToNull) {
656
private static BinaryExpression GetUserDefinedBinaryOperatorOrThrow(ExpressionType binaryType, string name,
Expression
left,
Expression
right, bool liftToNull) {
667
private static BinaryExpression GetUserDefinedAssignOperatorOrThrow(ExpressionType binaryType, string name,
Expression
left,
Expression
right, LambdaExpression conversion, bool liftToNull) {
743
private static bool IsNullComparison(
Expression
left,
Expression
right) {
763
private static bool IsNullConstant(
Expression
e) {
827
public static BinaryExpression MakeBinary(ExpressionType binaryType,
Expression
left,
Expression
right) {
840
public static BinaryExpression MakeBinary(ExpressionType binaryType,
Expression
left,
Expression
right, bool liftToNull, MethodInfo method) {
856
public static BinaryExpression MakeBinary(ExpressionType binaryType,
Expression
left,
Expression
right, bool liftToNull, MethodInfo method, LambdaExpression conversion) {
947
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
948
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
951
public static BinaryExpression Equal(
Expression
left,
Expression
right) {
958
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
959
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
965
public static BinaryExpression Equal(
Expression
left,
Expression
right, bool liftToNull, MethodInfo method) {
977
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
978
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
982
public static BinaryExpression ReferenceEqual(
Expression
left,
Expression
right) {
994
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
995
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
998
public static BinaryExpression NotEqual(
Expression
left,
Expression
right) {
1005
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1006
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1012
public static BinaryExpression NotEqual(
Expression
left,
Expression
right, bool liftToNull, MethodInfo method) {
1024
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1025
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1029
public static BinaryExpression ReferenceNotEqual(
Expression
left,
Expression
right) {
1038
private static BinaryExpression GetEqualityComparisonOperator(ExpressionType binaryType, string opName,
Expression
left,
Expression
right, bool liftToNull) {
1073
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1074
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1077
public static BinaryExpression GreaterThan(
Expression
left,
Expression
right) {
1084
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1085
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1091
public static BinaryExpression GreaterThan(
Expression
left,
Expression
right, bool liftToNull, MethodInfo method) {
1103
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1104
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1108
public static BinaryExpression LessThan(
Expression
left,
Expression
right) {
1115
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1116
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1122
public static BinaryExpression LessThan(
Expression
left,
Expression
right, bool liftToNull, MethodInfo method) {
1135
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1136
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1139
public static BinaryExpression GreaterThanOrEqual(
Expression
left,
Expression
right) {
1146
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1147
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1153
public static BinaryExpression GreaterThanOrEqual(
Expression
left,
Expression
right, bool liftToNull, MethodInfo method) {
1166
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1167
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1170
public static BinaryExpression LessThanOrEqual(
Expression
left,
Expression
right) {
1177
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1178
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1184
public static BinaryExpression LessThanOrEqual(
Expression
left,
Expression
right, bool liftToNull, MethodInfo method) {
1194
private static BinaryExpression GetComparisonOperator(ExpressionType binaryType, string opName,
Expression
left,
Expression
right, bool liftToNull) {
1213
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1214
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1217
public static BinaryExpression AndAlso(
Expression
left,
Expression
right) {
1224
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1225
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1230
public static BinaryExpression AndAlso(
Expression
left,
Expression
right, MethodInfo method) {
1259
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1260
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1263
public static BinaryExpression OrElse(
Expression
left,
Expression
right) {
1270
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1271
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1276
public static BinaryExpression OrElse(
Expression
left,
Expression
right, MethodInfo method) {
1309
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1310
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1312
public static BinaryExpression Coalesce(
Expression
left,
Expression
right) {
1320
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1321
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1325
public static BinaryExpression Coalesce(
Expression
left,
Expression
right, LambdaExpression conversion) {
1391
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1392
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1395
public static BinaryExpression Add(
Expression
left,
Expression
right) {
1402
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1403
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1408
public static BinaryExpression Add(
Expression
left,
Expression
right, MethodInfo method) {
1424
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1425
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1428
public static BinaryExpression AddAssign(
Expression
left,
Expression
right) {
1435
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1436
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1441
public static BinaryExpression AddAssign(
Expression
left,
Expression
right, MethodInfo method) {
1448
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1449
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1457
public static BinaryExpression AddAssign(
Expression
left,
Expression
right, MethodInfo method, LambdaExpression conversion) {
1474
private static void ValidateOpAssignConversionLambda(LambdaExpression conversion,
Expression
left, MethodInfo method, ExpressionType nodeType) {
1498
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1499
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1504
public static BinaryExpression AddAssignChecked(
Expression
left,
Expression
right) {
1511
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1512
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1517
public static BinaryExpression AddAssignChecked(
Expression
left,
Expression
right, MethodInfo method) {
1524
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1525
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1532
public static BinaryExpression AddAssignChecked(
Expression
left,
Expression
right, MethodInfo method, LambdaExpression conversion) {
1554
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1555
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1558
public static BinaryExpression AddChecked(
Expression
left,
Expression
right) {
1565
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1566
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1571
public static BinaryExpression AddChecked(
Expression
left,
Expression
right, MethodInfo method) {
1587
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1588
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1591
public static BinaryExpression Subtract(
Expression
left,
Expression
right) {
1598
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1599
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1604
public static BinaryExpression Subtract(
Expression
left,
Expression
right, MethodInfo method) {
1620
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1621
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1624
public static BinaryExpression SubtractAssign(
Expression
left,
Expression
right) {
1631
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1632
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1637
public static BinaryExpression SubtractAssign(
Expression
left,
Expression
right, MethodInfo method) {
1644
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1645
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1652
public static BinaryExpression SubtractAssign(
Expression
left,
Expression
right, MethodInfo method, LambdaExpression conversion) {
1673
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1674
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1677
public static BinaryExpression SubtractAssignChecked(
Expression
left,
Expression
right) {
1684
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1685
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1690
public static BinaryExpression SubtractAssignChecked(
Expression
left,
Expression
right, MethodInfo method) {
1697
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1698
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1705
public static BinaryExpression SubtractAssignChecked(
Expression
left,
Expression
right, MethodInfo method, LambdaExpression conversion) {
1726
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1727
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1730
public static BinaryExpression SubtractChecked(
Expression
left,
Expression
right) {
1737
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1738
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1743
public static BinaryExpression SubtractChecked(
Expression
left,
Expression
right, MethodInfo method) {
1759
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1760
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1763
public static BinaryExpression Divide(
Expression
left,
Expression
right) {
1770
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1771
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1776
public static BinaryExpression Divide(
Expression
left,
Expression
right, MethodInfo method) {
1792
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1793
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1796
public static BinaryExpression DivideAssign(
Expression
left,
Expression
right) {
1803
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1804
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1809
public static BinaryExpression DivideAssign(
Expression
left,
Expression
right, MethodInfo method) {
1816
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1817
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1824
public static BinaryExpression DivideAssign(
Expression
left,
Expression
right, MethodInfo method, LambdaExpression conversion) {
1845
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1846
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1849
public static BinaryExpression Modulo(
Expression
left,
Expression
right) {
1856
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1857
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1862
public static BinaryExpression Modulo(
Expression
left,
Expression
right, MethodInfo method) {
1878
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1879
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1882
public static BinaryExpression ModuloAssign(
Expression
left,
Expression
right) {
1889
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1890
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1895
public static BinaryExpression ModuloAssign(
Expression
left,
Expression
right, MethodInfo method) {
1902
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1903
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1910
public static BinaryExpression ModuloAssign(
Expression
left,
Expression
right, MethodInfo method, LambdaExpression conversion) {
1931
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1932
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1935
public static BinaryExpression Multiply(
Expression
left,
Expression
right) {
1942
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1943
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1948
public static BinaryExpression Multiply(
Expression
left,
Expression
right, MethodInfo method) {
1964
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1965
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1968
public static BinaryExpression MultiplyAssign(
Expression
left,
Expression
right) {
1975
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1976
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1981
public static BinaryExpression MultiplyAssign(
Expression
left,
Expression
right, MethodInfo method) {
1988
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
1989
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
1996
public static BinaryExpression MultiplyAssign(
Expression
left,
Expression
right, MethodInfo method, LambdaExpression conversion) {
2017
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2018
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2021
public static BinaryExpression MultiplyAssignChecked(
Expression
left,
Expression
right) {
2028
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2029
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2034
public static BinaryExpression MultiplyAssignChecked(
Expression
left,
Expression
right, MethodInfo method) {
2041
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2042
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2049
public static BinaryExpression MultiplyAssignChecked(
Expression
left,
Expression
right, MethodInfo method, LambdaExpression conversion) {
2070
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2071
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2074
public static BinaryExpression MultiplyChecked(
Expression
left,
Expression
right) {
2081
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2082
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2087
public static BinaryExpression MultiplyChecked(
Expression
left,
Expression
right, MethodInfo method) {
2116
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2117
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2120
public static BinaryExpression LeftShift(
Expression
left,
Expression
right) {
2127
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2128
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2133
public static BinaryExpression LeftShift(
Expression
left,
Expression
right, MethodInfo method) {
2150
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2151
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2154
public static BinaryExpression LeftShiftAssign(
Expression
left,
Expression
right) {
2161
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2162
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2167
public static BinaryExpression LeftShiftAssign(
Expression
left,
Expression
right, MethodInfo method) {
2174
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2175
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2182
public static BinaryExpression LeftShiftAssign(
Expression
left,
Expression
right, MethodInfo method, LambdaExpression conversion) {
2204
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2205
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2208
public static BinaryExpression RightShift(
Expression
left,
Expression
right) {
2215
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2216
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2221
public static BinaryExpression RightShift(
Expression
left,
Expression
right, MethodInfo method) {
2238
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2239
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2242
public static BinaryExpression RightShiftAssign(
Expression
left,
Expression
right) {
2249
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2250
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2255
public static BinaryExpression RightShiftAssign(
Expression
left,
Expression
right, MethodInfo method) {
2262
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2263
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2270
public static BinaryExpression RightShiftAssign(
Expression
left,
Expression
right, MethodInfo method, LambdaExpression conversion) {
2292
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2293
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2296
public static BinaryExpression And(
Expression
left,
Expression
right) {
2303
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2304
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2309
public static BinaryExpression And(
Expression
left,
Expression
right, MethodInfo method) {
2325
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2326
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2329
public static BinaryExpression AndAssign(
Expression
left,
Expression
right) {
2336
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2337
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2342
public static BinaryExpression AndAssign(
Expression
left,
Expression
right, MethodInfo method) {
2349
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2350
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2357
public static BinaryExpression AndAssign(
Expression
left,
Expression
right, MethodInfo method, LambdaExpression conversion) {
2378
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2379
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2382
public static BinaryExpression Or(
Expression
left,
Expression
right) {
2389
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2390
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2395
public static BinaryExpression Or(
Expression
left,
Expression
right, MethodInfo method) {
2411
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2412
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2415
public static BinaryExpression OrAssign(
Expression
left,
Expression
right) {
2422
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2423
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2428
public static BinaryExpression OrAssign(
Expression
left,
Expression
right, MethodInfo method) {
2435
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2436
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2443
public static BinaryExpression OrAssign(
Expression
left,
Expression
right, MethodInfo method, LambdaExpression conversion) {
2463
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2464
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2467
public static BinaryExpression ExclusiveOr(
Expression
left,
Expression
right) {
2474
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2475
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2480
public static BinaryExpression ExclusiveOr(
Expression
left,
Expression
right, MethodInfo method) {
2495
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2496
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2499
public static BinaryExpression ExclusiveOrAssign(
Expression
left,
Expression
right) {
2506
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2507
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2512
public static BinaryExpression ExclusiveOrAssign(
Expression
left,
Expression
right, MethodInfo method) {
2519
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2520
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2527
public static BinaryExpression ExclusiveOrAssign(
Expression
left,
Expression
right, MethodInfo method, LambdaExpression conversion) {
2547
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2548
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2551
public static BinaryExpression Power(
Expression
left,
Expression
right) {
2558
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2559
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2564
public static BinaryExpression Power(
Expression
left,
Expression
right, MethodInfo method) {
2581
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2582
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2585
public static BinaryExpression PowerAssign(
Expression
left,
Expression
right) {
2592
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2593
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2598
public static BinaryExpression PowerAssign(
Expression
left,
Expression
right, MethodInfo method) {
2605
/// <param name="left">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Left"/> property equal to.</param>
2606
/// <param name="right">An <see cref="
Expression
"/> to set the <see cref="P:BinaryExpression.Right"/> property equal to.</param>
2613
public static BinaryExpression PowerAssign(
Expression
left,
Expression
right, MethodInfo method, LambdaExpression conversion) {
2638
public static BinaryExpression ArrayIndex(
Expression
array,
Expression
index) {
Microsoft\Scripting\Ast\BlockExpression.cs (103)
36
[DebuggerTypeProxy(typeof(
Expression
.BlockExpressionProxy))]
42
public ReadOnlyCollection<
Expression
> Expressions {
58
public
Expression
Result {
71
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
85
/// Gets the static type of the expression that this <see cref="
Expression
" /> represents.
100
public BlockExpression Update(IEnumerable<ParameterExpression> variables, IEnumerable<
Expression
> expressions) {
105
return
Expression
.Block(Type, variables, expressions);
108
internal virtual
Expression
GetExpression(int index) {
118
internal virtual ReadOnlyCollection<
Expression
> GetOrMakeExpressions() {
146
internal virtual BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression> variables,
Expression
[] args) {
163
internal static ReadOnlyCollection<
Expression
> ReturnReadOnlyExpressions(BlockExpression provider, ref object collection) {
164
Expression
tObj = collection as
Expression
;
169
new ReadOnlyCollection<
Expression
>(new BlockExpressionList(provider, tObj)),
175
return (ReadOnlyCollection<
Expression
>)collection;
183
private readonly
Expression
_arg1; // storage for the 2nd argument.
185
internal Block2(
Expression
arg0,
Expression
arg1) {
190
internal override
Expression
GetExpression(int index) {
192
case 0: return ReturnObject<
Expression
>(_arg0);
204
internal override ReadOnlyCollection<
Expression
> GetOrMakeExpressions() {
208
internal override BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression> variables,
Expression
[] args) {
218
private readonly
Expression
_arg1, _arg2; // storage for the 2nd and 3rd arguments.
220
internal Block3(
Expression
arg0,
Expression
arg1,
Expression
arg2) {
226
internal override
Expression
GetExpression(int index) {
228
case 0: return ReturnObject<
Expression
>(_arg0);
241
internal override ReadOnlyCollection<
Expression
> GetOrMakeExpressions() {
245
internal override BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression> variables,
Expression
[] args) {
255
private readonly
Expression
_arg1, _arg2, _arg3; // storarg for the 2nd, 3rd, and 4th arguments.
257
internal Block4(
Expression
arg0,
Expression
arg1,
Expression
arg2,
Expression
arg3) {
264
internal override
Expression
GetExpression(int index) {
266
case 0: return ReturnObject<
Expression
>(_arg0);
280
internal override ReadOnlyCollection<
Expression
> GetOrMakeExpressions() {
284
internal override BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression> variables,
Expression
[] args) {
294
private readonly
Expression
_arg1, _arg2, _arg3, _arg4; // storage for the 2nd - 5th args.
296
internal Block5(
Expression
arg0,
Expression
arg1,
Expression
arg2,
Expression
arg3,
Expression
arg4) {
304
internal override
Expression
GetExpression(int index) {
306
case 0: return ReturnObject<
Expression
>(_arg0);
321
internal override ReadOnlyCollection<
Expression
> GetOrMakeExpressions() {
325
internal override BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression> variables,
Expression
[] args) {
334
private IList<
Expression
> _expressions; // either the original IList<Expression> or a ReadOnlyCollection if the user has accessed it.
336
internal BlockN(IList<
Expression
> expressions) {
342
internal override
Expression
GetExpression(int index) {
354
internal override ReadOnlyCollection<
Expression
> GetOrMakeExpressions() {
358
internal override BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression> variables,
Expression
[] args) {
407
internal Scope1(IList<ParameterExpression> variables,
Expression
body)
412
internal override
Expression
GetExpression(int index) {
414
case 0: return ReturnObject<
Expression
>(_body);
425
internal override ReadOnlyCollection<
Expression
> GetOrMakeExpressions() {
429
internal override BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression> variables,
Expression
[] args) {
438
private IList<
Expression
> _body;
440
internal ScopeN(IList<ParameterExpression> variables, IList<
Expression
> body)
445
internal override
Expression
GetExpression(int index) {
455
internal override ReadOnlyCollection<
Expression
> GetOrMakeExpressions() {
459
internal override BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression> variables,
Expression
[] args) {
470
internal ScopeWithType(IList<ParameterExpression> variables, IList<
Expression
> expressions, Type type)
479
internal override BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression> variables,
Expression
[] args) {
501
internal class BlockExpressionList : IList<
Expression
> {
503
private readonly
Expression
_arg0;
505
internal BlockExpressionList(BlockExpression provider,
Expression
arg0) {
512
public int IndexOf(
Expression
item) {
526
public void Insert(int index,
Expression
item) {
534
public
Expression
this[int index] {
551
public void Add(
Expression
item) {
559
public bool Contains(
Expression
item) {
563
public void CopyTo(
Expression
[] array, int arrayIndex) {
578
public bool Remove(
Expression
item) {
586
public IEnumerator<
Expression
> GetEnumerator() {
619
public static BlockExpression Block(
Expression
arg0,
Expression
arg1) {
632
public static BlockExpression Block(
Expression
arg0,
Expression
arg1,
Expression
arg2) {
647
public static BlockExpression Block(
Expression
arg0,
Expression
arg1,
Expression
arg2,
Expression
arg3) {
664
public static BlockExpression Block(
Expression
arg0,
Expression
arg1,
Expression
arg2,
Expression
arg3,
Expression
arg4) {
679
public static BlockExpression Block(params
Expression
[] expressions) {
699
public static BlockExpression Block(IEnumerable<
Expression
> expressions) {
709
public static BlockExpression Block(Type type, params
Expression
[] expressions) {
711
return Block(type, (IEnumerable<
Expression
>)expressions);
720
public static BlockExpression Block(Type type, IEnumerable<
Expression
> expressions) {
730
public static BlockExpression Block(IEnumerable<ParameterExpression> variables, params
Expression
[] expressions) {
731
return Block(variables, (IEnumerable<
Expression
>)expressions);
741
public static BlockExpression Block(Type type, IEnumerable<ParameterExpression> variables, params
Expression
[] expressions) {
742
return Block(type, variables, (IEnumerable<
Expression
>)expressions);
751
public static BlockExpression Block(IEnumerable<ParameterExpression> variables, IEnumerable<
Expression
> expressions) {
767
public static BlockExpression Block(Type type, IEnumerable<ParameterExpression> variables, IEnumerable<
Expression
> expressions) {
778
Expression
last = expressionList.Last();
Microsoft\Scripting\Ast\CatchBlock.cs (18)
35
[DebuggerTypeProxy(typeof(
Expression
.CatchBlockProxy))]
40
private readonly
Expression
_body;
41
private readonly
Expression
_filter;
43
internal CatchBlock(Type test, ParameterExpression variable,
Expression
body,
Expression
filter) {
67
public
Expression
Body {
74
public
Expression
Filter {
97
public CatchBlock Update(ParameterExpression variable,
Expression
filter,
Expression
body) {
101
return
Expression
.MakeCatchBlock(Test, variable, body, filter);
114
public static CatchBlock Catch(Type type,
Expression
body) {
124
public static CatchBlock Catch(ParameterExpression variable,
Expression
body) {
137
public static CatchBlock Catch(Type type,
Expression
body,
Expression
filter) {
149
public static CatchBlock Catch(ParameterExpression variable,
Expression
body,
Expression
filter) {
163
public static CatchBlock MakeCatchBlock(Type type, ParameterExpression variable,
Expression
body,
Expression
filter) {
Microsoft\Scripting\Ast\ConditionalExpression.cs (50)
34
[DebuggerTypeProxy(typeof(
Expression
.ConditionalExpressionProxy))]
37
private readonly
Expression
_test;
38
private readonly
Expression
_true;
40
internal ConditionalExpression(
Expression
test,
Expression
ifTrue) {
45
internal static ConditionalExpression Make(
Expression
test,
Expression
ifTrue,
Expression
ifFalse, Type type) {
65
/// Gets the static type of the expression that this <see cref="
Expression
" /> represents.
75
public
Expression
Test {
81
public
Expression
IfTrue {
87
public
Expression
IfFalse {
91
internal virtual
Expression
GetFalse() {
92
return
Expression
.Empty();
98
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
111
public ConditionalExpression Update(
Expression
test,
Expression
ifTrue,
Expression
ifFalse) {
115
return
Expression
.Condition(test, ifTrue, ifFalse, Type);
120
private readonly
Expression
_false;
122
internal FullConditionalExpression(
Expression
test,
Expression
ifTrue,
Expression
ifFalse)
127
internal override
Expression
GetFalse() {
135
internal FullConditionalExpressionWithType(
Expression
test,
Expression
ifTrue,
Expression
ifFalse, Type type)
150
/// <param name="test">An <see cref="
Expression
"/> to set the <see cref="P:ConditionalExpression.Test"/> property equal to.</param>
151
/// <param name="ifTrue">An <see cref="
Expression
"/> to set the <see cref="P:ConditionalExpression.IfTrue"/> property equal to.</param>
152
/// <param name="ifFalse">An <see cref="
Expression
"/> to set the <see cref="P:ConditionalExpression.IfFalse"/> property equal to.</param>
156
public static ConditionalExpression Condition(
Expression
test,
Expression
ifTrue,
Expression
ifFalse) {
175
/// <param name="test">An <see cref="
Expression
"/> to set the <see cref="P:ConditionalExpression.Test"/> property equal to.</param>
176
/// <param name="ifTrue">An <see cref="
Expression
"/> to set the <see cref="P:ConditionalExpression.IfTrue"/> property equal to.</param>
177
/// <param name="ifFalse">An <see cref="
Expression
"/> to set the <see cref="P:ConditionalExpression.IfFalse"/> property equal to.</param>
185
public static ConditionalExpression Condition(
Expression
test,
Expression
ifTrue,
Expression
ifFalse, Type type) {
208
/// <param name="test">An <see cref="
Expression
"/> to set the <see cref="P:ConditionalExpression.Test"/> property equal to.</param>
209
/// <param name="ifTrue">An <see cref="
Expression
"/> to set the <see cref="P:ConditionalExpression.IfTrue"/> property equal to.</param>
214
public static ConditionalExpression IfThen(
Expression
test,
Expression
ifTrue) {
215
return Condition(test, ifTrue,
Expression
.Empty(), typeof(void));
221
/// <param name="test">An <see cref="
Expression
"/> to set the <see cref="P:ConditionalExpression.Test"/> property equal to.</param>
222
/// <param name="ifTrue">An <see cref="
Expression
"/> to set the <see cref="P:ConditionalExpression.IfTrue"/> property equal to.</param>
223
/// <param name="ifFalse">An <see cref="
Expression
"/> to set the <see cref="P:ConditionalExpression.IfFalse"/> property equal to.</param>
228
public static ConditionalExpression IfThenElse(
Expression
test,
Expression
ifTrue,
Expression
ifFalse) {
Microsoft\Scripting\Ast\ConstantExpression.cs (3)
34
[DebuggerTypeProxy(typeof(
Expression
.ConstantExpressionProxy))]
54
/// Gets the static type of the expression that this <see cref="
Expression
" /> represents.
84
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
Microsoft\Scripting\Ast\DebugInfoExpression.cs (7)
36
[DebuggerTypeProxy(typeof(
Expression
.DebugInfoExpressionProxy))]
47
/// Gets the static type of the expression that this <see cref="
Expression
" /> represents. (Inherited from <see cref="
Expression
"/>.)
55
/// Returns the node type of this <see cref="
Expression
" />. (Inherited from <see cref="
Expression
" />.)
107
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
155
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
Microsoft\Scripting\Ast\DebugViewWriter.cs (40)
135
internal static void WriteTo(
Expression
node, TextWriter writer) {
142
private void WriteTo(
Expression
node) {
265
private void VisitExpressions<T>(char open, IList<T> expressions) where T :
Expression
{
269
private void VisitExpressions<T>(char open, char separator, IList<T> expressions) where T :
Expression
{
320
protected internal override
Expression
VisitDynamic(DynamicExpression node) {
328
protected internal override
Expression
VisitBinary(BinaryExpression node) {
415
protected internal override
Expression
VisitParameter(ParameterExpression node) {
430
protected internal override
Expression
VisitLambda<T>(Expression<T> node) {
452
private static bool IsSimpleExpression(
Expression
node) {
461
protected internal override
Expression
VisitConditional(ConditionalExpression node) {
484
protected internal override
Expression
VisitConstant(ConstantExpression node) {
540
protected internal override
Expression
VisitRuntimeVariables(RuntimeVariablesExpression node) {
547
private void OutMember(
Expression
node,
Expression
instance, MemberInfo member) {
557
protected internal override
Expression
VisitMember(MemberExpression node) {
562
protected internal override
Expression
VisitInvocation(InvocationExpression node) {
570
private static bool NeedsParentheses(
Expression
parent,
Expression
child) {
643
private static int GetOperatorPrecedence(
Expression
node) {
762
private void ParenthesizedVisit(
Expression
parent,
Expression
nodeToVisit) {
772
protected internal override
Expression
VisitMethodCall(MethodCallExpression node) {
787
protected internal override
Expression
VisitNewArray(NewArrayExpression node) {
800
protected internal override
Expression
VisitNew(NewExpression node) {
815
protected internal override
Expression
VisitListInit(ListInitExpression node) {
842
protected internal override
Expression
VisitMemberInit(MemberInitExpression node) {
848
protected internal override
Expression
VisitTypeBinary(TypeBinaryExpression node) {
863
protected internal override
Expression
VisitUnary(UnaryExpression node) {
946
protected internal override
Expression
VisitBlock(BlockExpression node) {
963
protected internal override
Expression
VisitDefault(DefaultExpression node) {
968
protected internal override
Expression
VisitLabel(LabelExpression node) {
978
protected internal override
Expression
VisitGoto(GotoExpression node) {
987
protected internal override
Expression
VisitLoop(LoopExpression node) {
1005
foreach (
var
test in node.TestValues) {
1017
protected internal override
Expression
VisitSwitch(SwitchExpression node) {
1051
protected internal override
Expression
VisitTry(TryExpression node) {
1073
protected internal override
Expression
VisitIndex(IndexExpression node) {
1084
protected internal override
Expression
VisitExtension(
Expression
node) {
1098
protected internal override
Expression
VisitDebugInfo(DebugInfoExpression node) {
Microsoft\Scripting\Ast\DefaultExpression.cs (3)
28
[DebuggerTypeProxy(typeof(
Expression
.DefaultExpressionProxy))]
38
/// Gets the static type of the expression that this <see cref="
Expression
" /> represents.
57
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
Microsoft\Scripting\Ast\DynamicExpression.cs (137)
39
[DebuggerTypeProxy(typeof(
Expression
.DynamicExpressionProxy))]
52
internal static DynamicExpression Make(Type returnType, Type delegateType, CallSiteBinder binder, ReadOnlyCollection<
Expression
> arguments) {
60
internal static DynamicExpression Make(Type returnType, Type delegateType, CallSiteBinder binder,
Expression
arg0) {
68
internal static DynamicExpression Make(Type returnType, Type delegateType, CallSiteBinder binder,
Expression
arg0,
Expression
arg1) {
76
internal static DynamicExpression Make(Type returnType, Type delegateType, CallSiteBinder binder,
Expression
arg0,
Expression
arg1,
Expression
arg2) {
84
internal static DynamicExpression Make(Type returnType, Type delegateType, CallSiteBinder binder,
Expression
arg0,
Expression
arg1,
Expression
arg2,
Expression
arg3) {
93
/// Gets the static type of the expression that this <see cref="
Expression
" /> represents.
127
public ReadOnlyCollection<
Expression
> Arguments {
131
internal virtual ReadOnlyCollection<
Expression
> GetOrMakeArguments() {
138
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
149
internal virtual DynamicExpression Rewrite(
Expression
[] args) {
160
public DynamicExpression Update(IEnumerable<
Expression
> arguments) {
165
return
Expression
.MakeDynamic(DelegateType, Binder, arguments);
170
Expression
IArgumentProvider.GetArgument(int index) {
198
public static new DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, params
Expression
[] arguments) {
199
return
Expression
.Dynamic(binder, returnType, arguments);
218
public static new DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, IEnumerable<
Expression
> arguments) {
219
return
Expression
.Dynamic(binder, returnType, arguments);
238
public static new DynamicExpression Dynamic(CallSiteBinder binder, Type returnType,
Expression
arg0) {
239
return
Expression
.Dynamic(binder, returnType, arg0);
259
public static new DynamicExpression Dynamic(CallSiteBinder binder, Type returnType,
Expression
arg0,
Expression
arg1) {
260
return
Expression
.Dynamic(binder, returnType, arg0, arg1);
281
public static new DynamicExpression Dynamic(CallSiteBinder binder, Type returnType,
Expression
arg0,
Expression
arg1,
Expression
arg2) {
282
return
Expression
.Dynamic(binder, returnType, arg0, arg1, arg2);
304
public static new DynamicExpression Dynamic(CallSiteBinder binder, Type returnType,
Expression
arg0,
Expression
arg1,
Expression
arg2,
Expression
arg3) {
305
return
Expression
.Dynamic(binder, returnType, arg0, arg1, arg2, arg3);
321
public static new DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, IEnumerable<
Expression
> arguments) {
322
return
Expression
.MakeDynamic(delegateType, binder, arguments);
338
public static new DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, params
Expression
[] arguments) {
339
return
Expression
.MakeDynamic(delegateType, binder, arguments);
355
public static new DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder,
Expression
arg0) {
356
return
Expression
.MakeDynamic(delegateType, binder, arg0);
373
public static new DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder,
Expression
arg0,
Expression
arg1) {
374
return
Expression
.MakeDynamic(delegateType, binder, arg0, arg1);
392
public static new DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder,
Expression
arg0,
Expression
arg1,
Expression
arg2) {
393
return
Expression
.MakeDynamic(delegateType, binder, arg0, arg1, arg2);
412
public static new DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder,
Expression
arg0,
Expression
arg1,
Expression
arg2,
Expression
arg3) {
413
return
Expression
.MakeDynamic(delegateType, binder, arg0, arg1, arg2, arg3);
418
Expression
IDynamicExpression.Rewrite(
Expression
[] args)
432
private IList<
Expression
> _arguments; // storage for the original IList or readonly collection. See IArgumentProvider for more info.
434
internal DynamicExpressionN(Type delegateType, CallSiteBinder binder, IList<
Expression
> arguments)
439
Expression
IArgumentProvider.GetArgument(int index) {
449
internal override ReadOnlyCollection<
Expression
> GetOrMakeArguments() {
453
internal override DynamicExpression Rewrite(
Expression
[] args) {
456
return
Expression
.MakeDynamic(DelegateType, Binder, args);
463
internal TypedDynamicExpressionN(Type returnType, Type delegateType, CallSiteBinder binder, IList<
Expression
> arguments)
477
internal DynamicExpression1(Type delegateType, CallSiteBinder binder,
Expression
arg0)
482
Expression
IArgumentProvider.GetArgument(int index) {
484
case 0: return ReturnObject<
Expression
>(_arg0);
495
internal override ReadOnlyCollection<
Expression
> GetOrMakeArguments() {
499
internal override DynamicExpression Rewrite(
Expression
[] args) {
502
return
Expression
.MakeDynamic(DelegateType, Binder, args[0]);
509
internal TypedDynamicExpression1(Type retType, Type delegateType, CallSiteBinder binder,
Expression
arg0)
521
private readonly
Expression
_arg1; // storage for the 2nd argument
523
internal DynamicExpression2(Type delegateType, CallSiteBinder binder,
Expression
arg0,
Expression
arg1)
529
Expression
IArgumentProvider.GetArgument(int index) {
531
case 0: return ReturnObject<
Expression
>(_arg0);
543
internal override ReadOnlyCollection<
Expression
> GetOrMakeArguments() {
547
internal override DynamicExpression Rewrite(
Expression
[] args) {
550
return
Expression
.MakeDynamic(DelegateType, Binder, args[0], args[1]);
557
internal TypedDynamicExpression2(Type retType, Type delegateType, CallSiteBinder binder,
Expression
arg0,
Expression
arg1)
569
private readonly
Expression
_arg1, _arg2; // storage for the 2nd & 3rd arguments
571
internal DynamicExpression3(Type delegateType, CallSiteBinder binder,
Expression
arg0,
Expression
arg1,
Expression
arg2)
578
Expression
IArgumentProvider.GetArgument(int index) {
580
case 0: return ReturnObject<
Expression
>(_arg0);
593
internal override ReadOnlyCollection<
Expression
> GetOrMakeArguments() {
597
internal override DynamicExpression Rewrite(
Expression
[] args) {
600
return
Expression
.MakeDynamic(DelegateType, Binder, args[0], args[1], args[2]);
607
internal TypedDynamicExpression3(Type retType, Type delegateType, CallSiteBinder binder,
Expression
arg0,
Expression
arg1,
Expression
arg2)
619
private readonly
Expression
_arg1, _arg2, _arg3; // storage for the 2nd - 4th arguments
621
internal DynamicExpression4(Type delegateType, CallSiteBinder binder,
Expression
arg0,
Expression
arg1,
Expression
arg2,
Expression
arg3)
629
Expression
IArgumentProvider.GetArgument(int index) {
631
case 0: return ReturnObject<
Expression
>(_arg0);
645
internal override ReadOnlyCollection<
Expression
> GetOrMakeArguments() {
649
internal override DynamicExpression Rewrite(
Expression
[] args) {
652
return
Expression
.MakeDynamic(DelegateType, Binder, args[0], args[1], args[2], args[3]);
659
internal TypedDynamicExpression4(Type retType, Type delegateType, CallSiteBinder binder,
Expression
arg0,
Expression
arg1,
Expression
arg2,
Expression
arg3)
686
public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, params
Expression
[] arguments) {
687
return MakeDynamic(delegateType, binder, (IEnumerable<
Expression
>)arguments);
703
public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, IEnumerable<
Expression
> arguments) {
729
public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder,
Expression
arg0) {
758
public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder,
Expression
arg0,
Expression
arg1) {
790
public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder,
Expression
arg0,
Expression
arg1,
Expression
arg2) {
825
public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder,
Expression
arg0,
Expression
arg1,
Expression
arg2,
Expression
arg3) {
869
public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, params
Expression
[] arguments) {
870
return Dynamic(binder, returnType, (IEnumerable<
Expression
>)arguments);
889
public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType,
Expression
arg0) {
926
public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType,
Expression
arg0,
Expression
arg1) {
968
public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType,
Expression
arg0,
Expression
arg1,
Expression
arg2) {
1015
public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType,
Expression
arg0,
Expression
arg1,
Expression
arg2,
Expression
arg3) {
1063
public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, IEnumerable<
Expression
> arguments) {
1072
private static DynamicExpression MakeDynamic(CallSiteBinder binder, Type returnType, ReadOnlyCollection<
Expression
> args) {
1076
Expression
arg = args[i];
1095
private static void ValidateDynamicArgument(
Expression
arg) {
Microsoft\Scripting\Ast\ElementInit.cs (10)
37
private ReadOnlyCollection<
Expression
> _arguments;
39
internal ElementInit(MethodInfo addMethod, ReadOnlyCollection<
Expression
> arguments) {
53
public ReadOnlyCollection<
Expression
> Arguments {
57
Expression
IArgumentProvider.GetArgument(int index) {
82
public ElementInit Update(IEnumerable<
Expression
> arguments) {
86
return
Expression
.ElementInit(AddMethod, arguments);
98
public static ElementInit ElementInit(MethodInfo addMethod, params
Expression
[] arguments) {
99
return ElementInit(addMethod, arguments as IEnumerable<
Expression
>);
106
/// <param name="arguments">An <see cref="IEnumerable{T}"/> containing <see cref="
Expression
"/> elements to initialize the list.</param>
108
public static ElementInit ElementInit(MethodInfo addMethod, IEnumerable<
Expression
> arguments) {
Microsoft\Scripting\Ast\Expression.cs (27)
41
private delegate LambdaExpression LambdaFactory(
Expression
body, string name, bool tailCall, ReadOnlyCollection<ParameterExpression> parameters);
67
private static ConditionalWeakTable<
Expression
, ExtensionInfo> _legacyCtorSupportTable;
70
/// Constructs a new instance of <see cref="
Expression
"/>.
72
/// <param name="nodeType">The <see ctype="ExpressionType"/> of the <see cref="
Expression
"/>.</param>
73
/// <param name="type">The <see cref="Type"/> of the <see cref="
Expression
"/>.</param>
80
new ConditionalWeakTable<
Expression
, ExtensionInfo>(),
90
/// Constructs a new instance of <see cref="
Expression
"/>.
96
/// The <see cref="ExpressionType"/> of the <see cref="
Expression
"/>.
113
/// The <see cref="Type"/> of the value represented by this <see cref="
Expression
"/>.
143
public virtual
Expression
Reduce() {
160
protected internal virtual
Expression
VisitChildren(ExpressionVisitor visitor) {
179
protected internal virtual
Expression
Accept(ExpressionVisitor visitor) {
193
public
Expression
ReduceAndCheck() {
196
var
newNode = Reduce();
210
public
Expression
ReduceExtensions() {
211
var
node = this;
297
internal static ReadOnlyCollection<
Expression
> ReturnReadOnly(IArgumentProvider provider, ref object collection) {
298
Expression
tObj = collection as
Expression
;
303
new ReadOnlyCollection<
Expression
>(new ListArgumentProvider(provider, tObj)),
309
return (ReadOnlyCollection<
Expression
>)collection;
338
private static void RequiresCanRead(
Expression
expression, string paramName) {
364
private static void RequiresCanRead(IEnumerable<
Expression
> items, string paramName) {
367
IList<
Expression
> listItems = items as IList<
Expression
>;
375
foreach (
var
i in items) {
380
private static void RequiresCanWrite(
Expression
expression, string paramName) {
Microsoft\Scripting\Ast\Expression.DebuggerProxy.cs (32)
45
public
Expression
Left { get { return _node.Left; } }
48
public
Expression
Right { get { return _node.Right; } }
61
public ReadOnlyCollection<
Expression
> Expressions { get { return _node.Expressions; } }
63
public
Expression
Result { get { return _node.Result; } }
75
public
Expression
Body { get { return _node.Body; } }
76
public
Expression
Filter { get { return _node.Filter; } }
90
public
Expression
IfFalse { get { return _node.IfFalse; } }
91
public
Expression
IfTrue { get { return _node.IfTrue; } }
93
public
Expression
Test { get { return _node.Test; } }
150
public ReadOnlyCollection<
Expression
> Arguments { get { return _node.Arguments; } }
172
public
Expression
Value { get { return _node.Value; } }
182
public ReadOnlyCollection<
Expression
> Arguments { get { return _node.Arguments; } }
187
public
Expression
Object { get { return _node.Object; } }
198
public ReadOnlyCollection<
Expression
> Arguments { get { return _node.Arguments; } }
201
public
Expression
Expression { get { return _node.Expression; } }
215
public
Expression
DefaultValue { get { return _node.DefaultValue; } }
228
public
Expression
Body { get { return _node.Body; } }
261
public
Expression
Body { get { return _node.Body; } }
279
public
Expression
Expression { get { return _node.Expression; } }
307
public ReadOnlyCollection<
Expression
> Arguments { get { return _node.Arguments; } }
312
public
Expression
Object { get { return _node.Object; } }
325
public ReadOnlyCollection<
Expression
> Expressions { get { return _node.Expressions; } }
337
public ReadOnlyCollection<
Expression
> Arguments { get { return _node.Arguments; } }
382
public
Expression
Body { get { return _node.Body; } }
383
public ReadOnlyCollection<
Expression
> TestValues { get { return _node.TestValues; } }
397
public
Expression
DefaultBody { get { return _node.DefaultBody; } }
399
public
Expression
SwitchValue { get { return _node.SwitchValue; } }
410
public
Expression
Body { get { return _node.Body; } }
413
public
Expression
Fault { get { return _node.Fault; } }
414
public
Expression
Finally { get { return _node.Finally; } }
429
public
Expression
Expression { get { return _node.Expression; } }
448
public
Expression
Operand { get { return _node.Operand; } }
Microsoft\Scripting\Ast\ExpressionStringBuilder.cs (33)
118
internal static string ExpressionToString(
Expression
node) {
198
private void VisitExpressions<T>(char open, IList<T> expressions, char close) where T :
Expression
{
202
private void VisitExpressions<T>(char open, IList<T> expressions, char close, string seperator) where T :
Expression
{
218
protected internal override
Expression
VisitDynamic(DynamicExpression node) {
225
protected internal override
Expression
VisitBinary(BinaryExpression node) {
328
protected internal override
Expression
VisitParameter(ParameterExpression node) {
347
protected internal override
Expression
VisitLambda<T>(Expression<T> node) {
360
protected internal override
Expression
VisitListInit(ListInitExpression node) {
373
protected internal override
Expression
VisitConditional(ConditionalExpression node) {
384
protected internal override
Expression
VisitConstant(ConstantExpression node) {
404
protected internal override
Expression
VisitDebugInfo(DebugInfoExpression node) {
418
protected internal override
Expression
VisitRuntimeVariables(RuntimeVariablesExpression node) {
424
private void OutMember(
Expression
instance, MemberInfo member) {
434
protected internal override
Expression
VisitMember(MemberExpression node) {
439
protected internal override
Expression
VisitMemberInit(MemberInitExpression node) {
502
protected internal override
Expression
VisitInvocation(InvocationExpression node) {
517
protected internal override
Expression
VisitMethodCall(MethodCallExpression node) {
519
Expression
ob = node.Object;
541
protected internal override
Expression
VisitNewArray(NewArrayExpression node) {
577
protected internal override
Expression
VisitNew(NewExpression node) {
605
protected internal override
Expression
VisitTypeBinary(TypeBinaryExpression node) {
622
protected internal override
Expression
VisitUnary(UnaryExpression node) {
691
protected internal override
Expression
VisitBlock(BlockExpression node) {
702
protected internal override
Expression
VisitDefault(DefaultExpression node) {
709
protected internal override
Expression
VisitLabel(LabelExpression node) {
716
protected internal override
Expression
VisitGoto(GotoExpression node) {
727
protected internal override
Expression
VisitLoop(LoopExpression node) {
739
protected internal override
Expression
VisitSwitch(SwitchExpression node) {
756
protected internal override
Expression
VisitTry(TryExpression node) {
761
protected internal override
Expression
VisitIndex(IndexExpression node) {
777
protected internal override
Expression
VisitExtension(
Expression
node) {
781
if (toString.DeclaringType != typeof(
Expression
)) {
Microsoft\Scripting\Ast\ExpressionVisitor.cs (56)
55
public virtual
Expression
Visit(
Expression
node) {
68
public ReadOnlyCollection<
Expression
> Visit(ReadOnlyCollection<
Expression
> nodes) {
69
Expression
[] newNodes = null;
71
Expression
node = Visit(nodes[i]);
76
newNodes = new
Expression
[n];
86
return new TrueReadOnlyCollection<
Expression
>(newNodes);
89
internal
Expression
[] VisitArguments(IArgumentProvider nodes) {
90
Expression
[] newNodes = null;
92
Expression
curNode = nodes.GetArgument(i);
93
Expression
node = Visit(curNode);
98
newNodes = new
Expression
[n];
146
public T VisitAndConvert<T>(T node, string callerName) where T :
Expression
{
166
public ReadOnlyCollection<T> VisitAndConvert<T>(ReadOnlyCollection<T> nodes, string callerName) where T :
Expression
{
196
protected internal virtual
Expression
VisitBinary(BinaryExpression node) {
214
protected internal virtual
Expression
VisitBlock(BlockExpression node) {
216
Expression
[] nodes = null;
218
Expression
oldNode = node.GetExpression(i);
219
Expression
newNode = Visit(oldNode);
223
nodes = new
Expression
[count];
249
protected internal virtual
Expression
VisitConditional(ConditionalExpression node) {
259
protected internal virtual
Expression
VisitConstant(ConstantExpression node) {
269
protected internal virtual
Expression
VisitDebugInfo(DebugInfoExpression node) {
279
protected internal virtual
Expression
VisitDynamic(DynamicExpression node) {
280
Expression
[] a = VisitArguments((IArgumentProvider)node);
294
protected internal virtual
Expression
VisitDefault(DefaultExpression node) {
306
/// If it is not overridden, this method will call <see cref="
Expression
.VisitChildren" />,
308
/// <see cref="
Expression
.VisitChildren" /> will try to reduce the node.
310
protected internal virtual
Expression
VisitExtension(
Expression
node) {
320
protected internal virtual
Expression
VisitGoto(GotoExpression node) {
330
protected internal virtual
Expression
VisitInvocation(InvocationExpression node) {
331
Expression
e = Visit(node.Expression);
332
Expression
[] a = VisitArguments(node);
356
protected internal virtual
Expression
VisitLabel(LabelExpression node) {
367
protected internal virtual
Expression
VisitLambda<T>(Expression<T> node) {
377
protected internal virtual
Expression
VisitLoop(LoopExpression node) {
387
protected internal virtual
Expression
VisitMember(MemberExpression node) {
397
protected internal virtual
Expression
VisitIndex(IndexExpression node) {
398
Expression
o = Visit(node.Object);
399
Expression
[] a = VisitArguments(node);
413
protected internal virtual
Expression
VisitMethodCall(MethodCallExpression node) {
414
Expression
o = Visit(node.Object);
415
Expression
[] a = VisitArguments((IArgumentProvider)node);
429
protected internal virtual
Expression
VisitNewArray(NewArrayExpression node) {
440
protected internal virtual
Expression
VisitNew(NewExpression node) {
450
protected internal virtual
Expression
VisitParameter(ParameterExpression node) {
460
protected internal virtual
Expression
VisitRuntimeVariables(RuntimeVariablesExpression node) {
480
protected internal virtual
Expression
VisitSwitch(SwitchExpression node) {
507
protected internal virtual
Expression
VisitTry(TryExpression node) {
522
protected internal virtual
Expression
VisitTypeBinary(TypeBinaryExpression node) {
532
protected internal virtual
Expression
VisitUnary(UnaryExpression node) {
542
protected internal virtual
Expression
VisitMemberInit(MemberInitExpression node) {
555
protected internal virtual
Expression
VisitListInit(ListInitExpression node) {
707
protected internal override
Expression
VisitDynamic(DynamicExpression node) {
Microsoft\Scripting\Ast\GotoExpression.cs (20)
55
[DebuggerTypeProxy(typeof(
Expression
.GotoExpressionProxy))]
59
private readonly
Expression
_value;
63
internal GotoExpression(GotoExpressionKind kind, LabelTarget target,
Expression
value, Type type) {
71
/// Gets the static type of the expression that this <see cref="
Expression
" /> represents. (Inherited from <see cref="
Expression
"/>.)
79
/// Returns the node type of this <see cref="
Expression
" />. (Inherited from <see cref="
Expression
" />.)
90
public
Expression
Value {
111
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
123
public GotoExpression Update(LabelTarget target,
Expression
value) {
127
return
Expression
.MakeGoto(Kind, target, value, Type);
154
public static GotoExpression Break(LabelTarget target,
Expression
value) {
185
public static GotoExpression Break(LabelTarget target,
Expression
value, Type type) {
255
public static GotoExpression Return(LabelTarget target,
Expression
value) {
272
public static GotoExpression Return(LabelTarget target,
Expression
value, Type type) {
314
public static GotoExpression Goto(LabelTarget target,
Expression
value) {
331
public static GotoExpression Goto(LabelTarget target,
Expression
value, Type type) {
349
public static GotoExpression MakeGoto(GotoExpressionKind kind, LabelTarget target,
Expression
value, Type type) {
354
private static void ValidateGoto(LabelTarget target, ref
Expression
value, string targetParameter, string valueParameter) {
364
private static void ValidateGotoType(Type expectedType, ref
Expression
value, string paramName) {
Microsoft\Scripting\Ast\IArgumentProvider.cs (2)
59
Expression
GetArgument(int index);
66
internal static T[] Map<T>(this IArgumentProvider collection, Func<
Expression
, T> select) {
Microsoft\Scripting\Ast\IDynamicExpression.cs (2)
42
Expression
Rewrite(
Expression
[] args);
Microsoft\Scripting\Ast\IndexExpression.cs (53)
38
[DebuggerTypeProxy(typeof(
Expression
.IndexExpressionProxy))]
41
private readonly
Expression
_instance;
43
private IList<
Expression
> _arguments;
46
Expression
instance,
48
IList<
Expression
> arguments) {
61
/// Returns the node type of this <see cref="
Expression
" />. (Inherited from <see cref="
Expression
" />.)
69
/// Gets the static type of the expression that this <see cref="
Expression
" /> represents. (Inherited from <see cref="
Expression
"/>.)
84
public
Expression
Object {
98
public ReadOnlyCollection<
Expression
> Arguments {
110
public IndexExpression Update(
Expression
@object, IEnumerable<
Expression
> arguments) {
114
return
Expression
.MakeIndex(@object, Indexer, arguments);
117
Expression
IArgumentProvider.GetArgument(int index) {
130
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
134
internal
Expression
Rewrite(
Expression
instance,
Expression
[] arguments) {
138
return
Expression
.MakeIndex(instance, _indexer, arguments ?? _arguments);
148
/// <param name="indexer">An <see cref="
Expression
"/> representing the property to index.</param>
151
public static IndexExpression MakeIndex(
Expression
instance, PropertyInfo indexer, IEnumerable<
Expression
> arguments) {
169
public static IndexExpression ArrayAccess(
Expression
array, params
Expression
[] indexes) {
170
return ArrayAccess(array, (IEnumerable<
Expression
>)indexes);
181
public static IndexExpression ArrayAccess(
Expression
array, IEnumerable<
Expression
> indexes) {
194
foreach (
Expression
e in indexList) {
212
/// <param name="arguments">An array of <see cref="
Expression
"/> objects that are used to index the property.</param>
214
public static IndexExpression Property(
Expression
instance, string propertyName, params
Expression
[] arguments) {
226
private static PropertyInfo FindInstanceProperty(Type type, string propertyName,
Expression
[] arguments) {
244
private static string GetArgTypesString(
Expression
[] arguments) {
259
private static PropertyInfo FindProperty(Type type, string propertyName,
Expression
[] arguments, BindingFlags flags) {
275
private static int FindBestProperty(IEnumerable<PropertyInfo> properties,
Expression
[] args, out PropertyInfo property) {
292
private static bool IsCompatible(PropertyInfo pi,
Expression
[] args) {
330
/// <param name="arguments">An array of <see cref="
Expression
"/> objects that are used to index the property.</param>
332
public static IndexExpression Property(
Expression
instance, PropertyInfo indexer, params
Expression
[] arguments) {
333
return Property(instance, indexer, (IEnumerable<
Expression
>)arguments);
341
/// <param name="arguments">An <see cref="IEnumerable{T}"/> of <see cref="
Expression
"/> objects that are used to index the property.</param>
343
public static IndexExpression Property(
Expression
instance, PropertyInfo indexer, IEnumerable<
Expression
> arguments) {
354
private static void ValidateIndexedProperty(
Expression
instance, PropertyInfo property, ref ReadOnlyCollection<
Expression
> argList) {
400
private static void ValidateAccessor(
Expression
instance, MethodInfo method, ParameterInfo[] indexes, ref ReadOnlyCollection<
Expression
> arguments) {
416
private static void ValidateAccessorArgumentTypes(MethodInfo method, ParameterInfo[] indexes, ref ReadOnlyCollection<
Expression
> arguments) {
421
Expression
[] newArgs = null;
423
Expression
arg = arguments[i];
437
newArgs = new
Expression
[arguments.Count];
447
arguments = new TrueReadOnlyCollection<
Expression
>(newArgs);
Microsoft\Scripting\Ast\InvocationExpression.cs (21)
36
[DebuggerTypeProxy(typeof(
Expression
.InvocationExpressionProxy))]
39
private IList<
Expression
> _arguments;
40
private readonly
Expression
_lambda;
43
internal InvocationExpression(
Expression
lambda, IList<
Expression
> arguments, Type returnType) {
69
public
Expression
Expression {
76
public ReadOnlyCollection<
Expression
> Arguments {
88
public InvocationExpression Update(
Expression
expression, IEnumerable<
Expression
> arguments) {
93
return
Expression
.Invoke(expression, arguments);
96
Expression
IArgumentProvider.GetArgument(int index) {
109
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
113
internal InvocationExpression Rewrite(
Expression
lambda,
Expression
[] arguments) {
117
return
Expression
.Invoke(lambda, arguments ?? _arguments);
153
public static InvocationExpression Invoke(
Expression
expression, params
Expression
[] arguments) {
154
return Invoke(expression, (IEnumerable<
Expression
>)arguments);
179
public static InvocationExpression Invoke(
Expression
expression, IEnumerable<
Expression
> arguments) {
192
internal static MethodInfo GetInvokeMethod(
Expression
expression) {
Microsoft\Scripting\Ast\LabelExpression.cs (13)
25
/// Represents a label, which can be placed in any <see cref="
Expression
"/> context. If
31
[DebuggerTypeProxy(typeof(
Expression
.LabelExpressionProxy))]
34
private readonly
Expression
_defaultValue;
37
internal LabelExpression(LabelTarget label,
Expression
defaultValue) {
43
/// Gets the static type of the expression that this <see cref="
Expression
" /> represents. (Inherited from <see cref="
Expression
"/>.)
51
/// Returns the node type of this <see cref="
Expression
" />. (Inherited from <see cref="
Expression
" />.)
69
public
Expression
DefaultValue {
76
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
88
public LabelExpression Update(LabelTarget target,
Expression
defaultValue) {
92
return
Expression
.Label(target, defaultValue);
112
public static LabelExpression Label(LabelTarget target,
Expression
defaultValue) {
Microsoft\Scripting\Ast\LambdaExpression.cs (51)
45
[DebuggerTypeProxy(typeof(
Expression
.LambdaExpressionProxy))]
49
private readonly
Expression
_body;
57
Expression
body,
72
/// Gets the static type of the expression that this <see cref="
Expression
" /> represents. (Inherited from <see cref="
Expression
"/>.)
80
/// Returns the node type of this <see cref="
Expression
" />. (Inherited from <see cref="
Expression
" />.)
105
public
Expression
Body {
191
internal Expression(
Expression
body, string name, bool tailCall, ReadOnlyCollection<ParameterExpression> parameters)
226
public Expression<TDelegate> Update(
Expression
body, IEnumerable<ParameterExpression> parameters) {
230
return
Expression
.Lambda<TDelegate>(body, Name, TailCall, parameters);
236
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
244
internal static LambdaExpression Create(
Expression
body, string name, bool tailCall, ReadOnlyCollection<ParameterExpression> parameters) {
256
internal static LambdaExpression CreateLambda(Type delegateType,
Expression
body, string name, bool tailCall, ReadOnlyCollection<ParameterExpression> parameters) {
286
/// <param name="body">An <see cref="
Expression
"/> to set the <see cref="P:Body"/> property equal to. </param>
289
public static Expression<TDelegate> Lambda<TDelegate>(
Expression
body, params ParameterExpression[] parameters) {
297
/// <param name="body">An <see cref="
Expression
"/> to set the <see cref="P:Body"/> property equal to. </param>
301
public static Expression<TDelegate> Lambda<TDelegate>(
Expression
body, bool tailCall, params ParameterExpression[] parameters) {
309
/// <param name="body">An <see cref="
Expression
"/> to set the <see cref="P:Body"/> property equal to. </param>
312
public static Expression<TDelegate> Lambda<TDelegate>(
Expression
body, IEnumerable<ParameterExpression> parameters) {
320
/// <param name="body">An <see cref="
Expression
"/> to set the <see cref="P:Body"/> property equal to. </param>
324
public static Expression<TDelegate> Lambda<TDelegate>(
Expression
body, bool tailCall, IEnumerable<ParameterExpression> parameters) {
332
/// <param name="body">An <see cref="
Expression
"/> to set the <see cref="P:Body"/> property equal to. </param>
336
public static Expression<TDelegate> Lambda<TDelegate>(
Expression
body, String name, IEnumerable<ParameterExpression> parameters) {
344
/// <param name="body">An <see cref="
Expression
"/> to set the <see cref="P:Body"/> property equal to. </param>
349
public static Expression<TDelegate> Lambda<TDelegate>(
Expression
body, String name, bool tailCall, IEnumerable<ParameterExpression> parameters) {
359
/// <param name="body">An <see cref="
Expression
"/> to set the <see cref="P:Body"/> property equal to. </param>
362
public static LambdaExpression Lambda(
Expression
body, params ParameterExpression[] parameters) {
369
/// <param name="body">An <see cref="
Expression
"/> to set the <see cref="P:Body"/> property equal to. </param>
373
public static LambdaExpression Lambda(
Expression
body, bool tailCall, params ParameterExpression[] parameters) {
380
/// <param name="body">An <see cref="
Expression
"/> to set the <see cref="P:Body"/> property equal to. </param>
383
public static LambdaExpression Lambda(
Expression
body, IEnumerable<ParameterExpression> parameters) {
390
/// <param name="body">An <see cref="
Expression
"/> to set the <see cref="P:Body"/> property equal to. </param>
394
public static LambdaExpression Lambda(
Expression
body, bool tailCall, IEnumerable<ParameterExpression> parameters) {
401
/// <param name="body">An <see cref="
Expression
"/> to set the <see cref="P:Body"/> property equal to. </param>
405
public static LambdaExpression Lambda(Type delegateType,
Expression
body, params ParameterExpression[] parameters) {
412
/// <param name="body">An <see cref="
Expression
"/> to set the <see cref="P:Body"/> property equal to. </param>
417
public static LambdaExpression Lambda(Type delegateType,
Expression
body, bool tailCall, params ParameterExpression[] parameters) {
424
/// <param name="body">An <see cref="
Expression
"/> to set the <see cref="P:Body"/> property equal to. </param>
428
public static LambdaExpression Lambda(Type delegateType,
Expression
body, IEnumerable<ParameterExpression> parameters) {
435
/// <param name="body">An <see cref="
Expression
"/> to set the <see cref="P:Body"/> property equal to. </param>
440
public static LambdaExpression Lambda(Type delegateType,
Expression
body, bool tailCall, IEnumerable<ParameterExpression> parameters) {
447
/// <param name="body">An <see cref="
Expression
"/> to set the <see cref="P:Body"/> property equal to. </param>
451
public static LambdaExpression Lambda(
Expression
body, string name, IEnumerable<ParameterExpression> parameters) {
458
/// <param name="body">An <see cref="
Expression
"/> to set the <see cref="P:Body"/> property equal to. </param>
463
public static LambdaExpression Lambda(
Expression
body, string name, bool tailCall, IEnumerable<ParameterExpression> parameters) {
492
/// <param name="body">An <see cref="
Expression
"/> to set the <see cref="P:Body"/> property equal to. </param>
497
public static LambdaExpression Lambda(Type delegateType,
Expression
body, string name, IEnumerable<ParameterExpression> parameters) {
508
/// <param name="body">An <see cref="
Expression
"/> to set the <see cref="P:Body"/> property equal to. </param>
513
public static LambdaExpression Lambda(Type delegateType,
Expression
body, string name, bool tailCall, IEnumerable<ParameterExpression> parameters) {
520
private static void ValidateLambdaArgs(Type delegateType, ref
Expression
body, ReadOnlyCollection<ParameterExpression> parameters) {
Microsoft\Scripting\Ast\ListArgumentProvider.cs (11)
36
class ListArgumentProvider : IList<
Expression
> {
38
private readonly
Expression
_arg0;
40
internal ListArgumentProvider(IArgumentProvider provider,
Expression
arg0) {
47
public int IndexOf(
Expression
item) {
61
public void Insert(int index,
Expression
item) {
69
public
Expression
this[int index] {
86
public void Add(
Expression
item) {
94
public bool Contains(
Expression
item) {
98
public void CopyTo(
Expression
[] array, int arrayIndex) {
113
public bool Remove(
Expression
item) {
121
public IEnumerator<
Expression
> GetEnumerator() {
Microsoft\Scripting\Ast\ListInitExpression.cs (19)
41
[DebuggerTypeProxy(typeof(
Expression
.ListInitExpressionProxy))]
53
/// Returns the node type of this <see cref="
Expression
"/>. (Inherited from <see cref="
Expression
" />.)
61
/// Gets the static type of the expression that this <see cref="
Expression
" /> represents. (Inherited from <see cref="
Expression
"/>.)
94
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
105
public override
Expression
Reduce() {
121
return
Expression
.ListInit(newExpression, initializers);
131
/// <param name="initializers">An array of <see cref="
Expression
"/> objects to use to populate the <see cref="ListInitExpression.Initializers"/> collection.</param>
133
public static ListInitExpression ListInit(NewExpression newExpression, params
Expression
[] initializers) {
136
return ListInit(newExpression, initializers as IEnumerable<
Expression
>);
145
public static ListInitExpression ListInit(NewExpression newExpression, IEnumerable<
Expression
> initializers) {
154
MethodInfo addMethod = FindMethod(newExpression.Type, "Add", null, new
Expression
[] { initializerlist[0] }, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
163
/// <param name="initializers">An array of <see cref="
Expression
"/> objects to use to populate the <see cref="ListInitExpression.Initializers"/> collection.</param>
165
public static ListInitExpression ListInit(NewExpression newExpression, MethodInfo addMethod, params
Expression
[] initializers) {
167
return ListInit(newExpression, initializers as IEnumerable<
Expression
>);
171
return ListInit(newExpression, addMethod, initializers as IEnumerable<
Expression
>);
179
/// <param name="initializers">An <see cref="IEnumerable{T}"/> that contains <see cref="
Expression
"/> objects to use to populate the Initializers collection.</param>
181
public static ListInitExpression ListInit(NewExpression newExpression, MethodInfo addMethod, IEnumerable<
Expression
> initializers) {
Microsoft\Scripting\Ast\LoopExpression.cs (12)
33
[DebuggerTypeProxy(typeof(
Expression
.LoopExpressionProxy))]
36
private readonly
Expression
_body;
40
internal LoopExpression(
Expression
body, LabelTarget @break, LabelTarget @continue) {
47
/// Gets the static type of the expression that this <see cref="
Expression
" /> represents.
64
/// Gets the <see cref="
Expression
"/> that is the body of the loop.
66
public
Expression
Body {
87
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
100
public LoopExpression Update(LabelTarget breakLabel, LabelTarget continueLabel,
Expression
body) {
104
return
Expression
.Loop(body, breakLabel, continueLabel);
114
public static LoopExpression Loop(
Expression
body) {
124
public static LoopExpression Loop(
Expression
body, LabelTarget @break) {
135
public static LoopExpression Loop(
Expression
body, LabelTarget @break, LabelTarget @continue) {
Microsoft\Scripting\Ast\MemberAssignment.cs (7)
33
Expression
_expression;
34
internal MemberAssignment(MemberInfo member,
Expression
expression)
43
public
Expression
Expression {
54
public MemberAssignment Update(
Expression
expression) {
58
return
Expression
.Bind(Member, expression);
70
public static MemberAssignment Bind(MemberInfo member,
Expression
expression) {
87
public static MemberAssignment Bind(MethodInfo propertyAccessor,
Expression
expression) {
Microsoft\Scripting\Ast\MemberExpression.cs (23)
35
[DebuggerTypeProxy(typeof(
Expression
.MemberExpressionProxy))]
38
private readonly
Expression
_expression;
50
public
Expression
Expression {
55
internal MemberExpression(
Expression
expression) {
60
internal static MemberExpression Make(
Expression
expression, MemberInfo member) {
85
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
96
public MemberExpression Update(
Expression
expression) {
100
return
Expression
.MakeMemberAccess(expression, Member);
107
public FieldExpression(
Expression
expression, FieldInfo member)
123
public PropertyExpression(
Expression
expression, PropertyInfo member)
148
public static MemberExpression Field(
Expression
expression, FieldInfo field) {
169
public static MemberExpression Field(
Expression
expression, string fieldName) {
180
return
Expression
.Field(expression, fi);
192
public static MemberExpression Field(
Expression
expression, Type type, string fieldName) {
204
return
Expression
.Field(expression, fi);
216
public static MemberExpression Property(
Expression
expression, string propertyName) {
237
public static MemberExpression Property(
Expression
expression, Type type, string propertyName) {
258
public static MemberExpression Property(
Expression
expression, PropertyInfo property) {
285
public static MemberExpression Property(
Expression
expression, MethodInfo propertyAccessor) {
329
public static MemberExpression PropertyOrField(
Expression
expression, string propertyOrFieldName) {
354
public static MemberExpression MakeMemberAccess(
Expression
expression, MemberInfo member) {
359
return
Expression
.Field(expression, fi);
363
return
Expression
.Property(expression, pi);
Microsoft\Scripting\Ast\MemberInitExpression.cs (27)
32
[DebuggerTypeProxy(typeof(
Expression
.MemberInitExpressionProxy))]
44
/// Gets the static type of the expression that this <see cref="
Expression
" /> represents.
84
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
95
public override
Expression
Reduce() {
99
internal static
Expression
ReduceMemberInit(
Expression
objExpression, ReadOnlyCollection<MemberBinding> bindings, bool keepOnStack) {
100
var objVar =
Expression
.Variable(objExpression.Type, null);
102
var block = new
Expression
[count + 2];
103
block[0] =
Expression
.Assign(objVar, objExpression);
107
block[count + 1] = keepOnStack ? (
Expression
)objVar :
Expression
.Empty();
108
return
Expression
.Block(new TrueReadOnlyCollection<
Expression
>(block));
111
internal static
Expression
ReduceListInit(
Expression
listExpression, ReadOnlyCollection<ElementInit> initializers, bool keepOnStack) {
112
var listVar =
Expression
.Variable(listExpression.Type, null);
114
var block = new
Expression
[count + 2];
115
block[0] =
Expression
.Assign(listVar, listExpression);
118
block[i + 1] =
Expression
.Call(listVar, element.AddMethod, element.Arguments);
120
block[count + 1] = keepOnStack ? (
Expression
)listVar :
Expression
.Empty();
121
return
Expression
.Block(new TrueReadOnlyCollection<
Expression
>(block));
124
internal static
Expression
ReduceMemberBinding(ParameterExpression objVar, MemberBinding binding) {
125
MemberExpression member =
Expression
.MakeMemberAccess(objVar, binding.Member);
128
return
Expression
.Assign(member, ((MemberAssignment)binding).Expression);
149
return
Expression
.MemberInit(newExpression, bindings);
Microsoft\Scripting\Ast\MemberListBinding.cs (1)
63
return
Expression
.ListBind(Member, initializers);
Microsoft\Scripting\Ast\MemberMemberBinding.cs (1)
65
return
Expression
.MemberBind(Member, bindings);
Microsoft\Scripting\Ast\MethodCallExpression.cs (210)
37
[DebuggerTypeProxy(typeof(
Expression
.MethodCallExpressionProxy))]
47
internal virtual
Expression
GetInstance() {
52
/// Returns the node type of this <see cref="
Expression
" />. (Inherited from <see cref="
Expression
" />.)
60
/// Gets the static type of the expression that this <see cref="
Expression
" /> represents. (Inherited from <see cref="
Expression
"/>.)
75
/// Gets the <see cref="
Expression
" /> that represents the instance
78
public
Expression
Object {
85
public ReadOnlyCollection<
Expression
> Arguments {
97
public MethodCallExpression Update(
Expression
@object, IEnumerable<
Expression
> arguments) {
101
return
Expression
.Call(@object, Method, arguments);
104
internal virtual ReadOnlyCollection<
Expression
> GetOrMakeArguments() {
111
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
123
internal virtual MethodCallExpression Rewrite(
Expression
instance, IList<
Expression
> args) {
129
Expression
IArgumentProvider.GetArgument(int index) {
143
private IList<
Expression
> _arguments;
145
public MethodCallExpressionN(MethodInfo method, IList<
Expression
> args)
150
Expression
IArgumentProvider.GetArgument(int index) {
160
internal override ReadOnlyCollection<
Expression
> GetOrMakeArguments() {
164
internal override MethodCallExpression Rewrite(
Expression
instance, IList<
Expression
> args) {
168
return
Expression
.Call(Method, args ?? _arguments);
173
private IList<
Expression
> _arguments;
174
private readonly
Expression
_instance;
176
public InstanceMethodCallExpressionN(MethodInfo method,
Expression
instance, IList<
Expression
> args)
182
Expression
IArgumentProvider.GetArgument(int index) {
192
internal override
Expression
GetInstance() {
196
internal override ReadOnlyCollection<
Expression
> GetOrMakeArguments() {
200
internal override MethodCallExpression Rewrite(
Expression
instance, IList<
Expression
> args) {
204
return
Expression
.Call(instance, Method, args ?? _arguments);
211
public MethodCallExpression1(MethodInfo method,
Expression
arg0)
216
Expression
IArgumentProvider.GetArgument(int index) {
218
case 0: return ReturnObject<
Expression
>(_arg0);
229
internal override ReadOnlyCollection<
Expression
> GetOrMakeArguments() {
233
internal override MethodCallExpression Rewrite(
Expression
instance, IList<
Expression
> args) {
238
return
Expression
.Call(Method, args[0]);
241
return
Expression
.Call(Method, ReturnObject<
Expression
>(_arg0));
247
private readonly
Expression
_arg1; // storage for the 2nd arg
249
public MethodCallExpression2(MethodInfo method,
Expression
arg0,
Expression
arg1)
255
Expression
IArgumentProvider.GetArgument(int index) {
257
case 0: return ReturnObject<
Expression
>(_arg0);
269
internal override ReadOnlyCollection<
Expression
> GetOrMakeArguments() {
273
internal override MethodCallExpression Rewrite(
Expression
instance, IList<
Expression
> args) {
278
return
Expression
.Call(Method, args[0], args[1]);
280
return
Expression
.Call(Method, ReturnObject<
Expression
>(_arg0), _arg1);
286
private readonly
Expression
_arg1, _arg2; // storage for the 2nd - 3rd args.
288
public MethodCallExpression3(MethodInfo method,
Expression
arg0,
Expression
arg1,
Expression
arg2)
295
Expression
IArgumentProvider.GetArgument(int index) {
297
case 0: return ReturnObject<
Expression
>(_arg0);
310
internal override ReadOnlyCollection<
Expression
> GetOrMakeArguments() {
314
internal override MethodCallExpression Rewrite(
Expression
instance, IList<
Expression
> args) {
319
return
Expression
.Call(Method, args[0], args[1], args[2]);
321
return
Expression
.Call(Method, ReturnObject<
Expression
>(_arg0), _arg1, _arg2);
327
private readonly
Expression
_arg1, _arg2, _arg3; // storage for the 2nd - 4th args.
329
public MethodCallExpression4(MethodInfo method,
Expression
arg0,
Expression
arg1,
Expression
arg2,
Expression
arg3)
337
Expression
IArgumentProvider.GetArgument(int index) {
339
case 0: return ReturnObject<
Expression
>(_arg0);
353
internal override ReadOnlyCollection<
Expression
> GetOrMakeArguments() {
357
internal override MethodCallExpression Rewrite(
Expression
instance, IList<
Expression
> args) {
362
return
Expression
.Call(Method, args[0], args[1], args[2], args[3]);
364
return
Expression
.Call(Method, ReturnObject<
Expression
>(_arg0), _arg1, _arg2, _arg3);
370
private readonly
Expression
_arg1, _arg2, _arg3, _arg4; // storage for the 2nd - 5th args.
372
public MethodCallExpression5(MethodInfo method,
Expression
arg0,
Expression
arg1,
Expression
arg2,
Expression
arg3,
Expression
arg4)
381
Expression
IArgumentProvider.GetArgument(int index) {
383
case 0: return ReturnObject<
Expression
>(_arg0);
398
internal override ReadOnlyCollection<
Expression
> GetOrMakeArguments() {
402
internal override MethodCallExpression Rewrite(
Expression
instance, IList<
Expression
> args) {
407
return
Expression
.Call(Method, args[0], args[1], args[2], args[3], args[4]);
410
return
Expression
.Call(Method, ReturnObject<
Expression
>(_arg0), _arg1, _arg2, _arg3, _arg4);
415
private readonly
Expression
_instance;
417
private readonly
Expression
_arg1; // storage for the 2nd argument
419
public InstanceMethodCallExpression2(MethodInfo method,
Expression
instance,
Expression
arg0,
Expression
arg1)
428
Expression
IArgumentProvider.GetArgument(int index) {
430
case 0: return ReturnObject<
Expression
>(_arg0);
442
internal override
Expression
GetInstance() {
446
internal override ReadOnlyCollection<
Expression
> GetOrMakeArguments() {
450
internal override MethodCallExpression Rewrite(
Expression
instance, IList<
Expression
> args) {
455
return
Expression
.Call(instance, Method, args[0], args[1]);
457
return
Expression
.Call(instance, Method, ReturnObject<
Expression
>(_arg0), _arg1);
462
private readonly
Expression
_instance;
464
private readonly
Expression
_arg1, _arg2; // storage for the 2nd - 3rd argument
466
public InstanceMethodCallExpression3(MethodInfo method,
Expression
instance,
Expression
arg0,
Expression
arg1,
Expression
arg2)
476
Expression
IArgumentProvider.GetArgument(int index) {
478
case 0: return ReturnObject<
Expression
>(_arg0);
491
internal override
Expression
GetInstance() {
495
internal override ReadOnlyCollection<
Expression
> GetOrMakeArguments() {
499
internal override MethodCallExpression Rewrite(
Expression
instance, IList<
Expression
> args) {
504
return
Expression
.Call(instance, Method, args[0], args[1], args[2]);
506
return
Expression
.Call(instance, Method, ReturnObject<
Expression
>(_arg0), _arg1, _arg2);
519
///<param name="arg0">The <see cref="
Expression
" /> that represents the first argument.</param>
522
public static MethodCallExpression Call(MethodInfo method,
Expression
arg0) {
538
///<param name="arg0">The <see cref="
Expression
" /> that represents the first argument.</param>
539
///<param name="arg1">The <see cref="
Expression
" /> that represents the second argument.</param>
542
public static MethodCallExpression Call(MethodInfo method,
Expression
arg0,
Expression
arg1) {
560
///<param name="arg0">The <see cref="
Expression
" /> that represents the first argument.</param>
561
///<param name="arg1">The <see cref="
Expression
" /> that represents the second argument.</param>
562
///<param name="arg2">The <see cref="
Expression
" /> that represents the third argument.</param>
565
public static MethodCallExpression Call(MethodInfo method,
Expression
arg0,
Expression
arg1,
Expression
arg2) {
585
///<param name="arg0">The <see cref="
Expression
" /> that represents the first argument.</param>
586
///<param name="arg1">The <see cref="
Expression
" /> that represents the second argument.</param>
587
///<param name="arg2">The <see cref="
Expression
" /> that represents the third argument.</param>
588
///<param name="arg3">The <see cref="
Expression
" /> that represents the fourth argument.</param>
591
public static MethodCallExpression Call(MethodInfo method,
Expression
arg0,
Expression
arg1,
Expression
arg2,
Expression
arg3) {
613
///<param name="arg0">The <see cref="
Expression
" /> that represents the first argument.</param>
614
///<param name="arg1">The <see cref="
Expression
" /> that represents the second argument.</param>
615
///<param name="arg2">The <see cref="
Expression
" /> that represents the third argument.</param>
616
///<param name="arg3">The <see cref="
Expression
" /> that represents the fourth argument.</param>
617
///<param name="arg4">The <see cref="
Expression
" /> that represents the fifth argument.</param>
621
public static MethodCallExpression Call(MethodInfo method,
Expression
arg0,
Expression
arg1,
Expression
arg2,
Expression
arg3,
Expression
arg4) {
646
/// <param name="arguments">The array of one or more of <see cref="
Expression
" /> that represents the call arguments.</param>
648
public static MethodCallExpression Call(MethodInfo method, params
Expression
[] arguments) {
656
/// <param name="arguments">A collection of <see cref="
Expression
" /> that represents the call arguments.</param>
658
public static MethodCallExpression Call(MethodInfo method, IEnumerable<
Expression
> arguments) {
665
/// <param name="instance">An <see cref="
Expression
" /> that specifies the instance for an instance call. (pass null for a static (Shared in Visual Basic) method).</param>
668
public static MethodCallExpression Call(
Expression
instance, MethodInfo method) {
669
return Call(instance, method, EmptyReadOnlyCollection<
Expression
>.Instance);
675
/// <param name="instance">An <see cref="
Expression
" /> that specifies the instance for an instance call. (pass null for a static (Shared in Visual Basic) method).</param>
677
/// <param name="arguments">An array of one or more of <see cref="
Expression
" /> that represents the call arguments.</param>
679
public static MethodCallExpression Call(
Expression
instance, MethodInfo method, params
Expression
[] arguments) {
680
return Call(instance, method, (IEnumerable<
Expression
>)arguments);
686
/// <param name="instance">An <see cref="
Expression
" /> that specifies the instance for an instance call. (pass null for a static (Shared in Visual Basic) method).</param>
688
/// <param name="arg0">The <see cref="
Expression
" /> that represents the first argument.</param>
689
/// <param name="arg1">The <see cref="
Expression
" /> that represents the second argument.</param>
691
public static MethodCallExpression Call(
Expression
instance, MethodInfo method,
Expression
arg0,
Expression
arg1) {
713
/// <param name="instance">An <see cref="
Expression
" /> that specifies the instance for an instance call. (pass null for a static (Shared in Visual Basic) method).</param>
715
/// <param name="arg0">The <see cref="
Expression
" /> that represents the first argument.</param>
716
/// <param name="arg1">The <see cref="
Expression
" /> that represents the second argument.</param>
717
/// <param name="arg2">The <see cref="
Expression
" /> that represents the third argument.</param>
719
public static MethodCallExpression Call(
Expression
instance, MethodInfo method,
Expression
arg0,
Expression
arg1,
Expression
arg2) {
751
public static MethodCallExpression Call(
Expression
instance, string methodName, Type[] typeArguments, params
Expression
[] arguments) {
755
arguments = new
Expression
[0];
759
return
Expression
.Call(instance, FindMethod(instance.Type, methodName, typeArguments, arguments, flags), arguments);
774
public static MethodCallExpression Call(Type type, string methodName, Type[] typeArguments, params
Expression
[] arguments) {
778
if (arguments == null) arguments = new
Expression
[] { };
780
return
Expression
.Call(null, FindMethod(type, methodName, typeArguments, arguments, flags), arguments);
792
public static MethodCallExpression Call(
Expression
instance, MethodInfo method, IEnumerable<
Expression
> arguments) {
795
ReadOnlyCollection<
Expression
> argList = arguments.ToReadOnly();
808
private static ParameterInfo[] ValidateMethodAndGetParameters(
Expression
instance, MethodInfo method) {
815
private static void ValidateStaticOrInstanceMethod(
Expression
instance, MethodInfo method) {
834
private static void ValidateArgumentTypes(MethodBase method, ExpressionType nodeKind, ref ReadOnlyCollection<
Expression
> arguments) {
841
Expression
[] newArgs = null;
843
Expression
arg = arguments[i];
848
newArgs = new
Expression
[arguments.Count];
858
arguments = new TrueReadOnlyCollection<
Expression
>(newArgs);
888
private static
Expression
ValidateOneArgument(MethodBase method, ExpressionType nodeKind,
Expression
arg, ParameterInfo pi) {
915
private static bool TryQuote(Type parameterType, ref
Expression
argument) {
925
argument =
Expression
.Quote(argument);
931
private static MethodInfo FindMethod(Type type, string methodName, Type[] typeArgs,
Expression
[] args, BindingFlags flags) {
953
private static int FindBestMethod(IEnumerable<MethodInfo> methods, Type[] typeArgs,
Expression
[] args, out MethodInfo method) {
973
private static bool IsCompatible(MethodBase m,
Expression
[] args) {
978
Expression
arg = args[i];
1013
public static MethodCallExpression ArrayIndex(
Expression
array, params
Expression
[] indexes) {
1014
return ArrayIndex(array, (IEnumerable<
Expression
>)indexes);
1025
public static MethodCallExpression ArrayIndex(
Expression
array, IEnumerable<
Expression
> indexes) {
1034
ReadOnlyCollection<
Expression
> indexList = indexes.ToReadOnly();
1039
foreach (
Expression
e in indexList) {
Microsoft\Scripting\Ast\NewArrayExpression.cs (30)
37
[DebuggerTypeProxy(typeof(
Expression
.NewArrayExpressionProxy))]
40
private readonly ReadOnlyCollection<
Expression
> _expressions;
43
internal NewArrayExpression(Type type, ReadOnlyCollection<
Expression
> expressions) {
48
internal static NewArrayExpression Make(ExpressionType nodeType, Type type, ReadOnlyCollection<
Expression
> expressions) {
57
/// Gets the static type of the expression that this <see cref="
Expression
" /> represents. (Inherited from <see cref="
Expression
"/>.)
67
public ReadOnlyCollection<
Expression
> Expressions {
74
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
85
public NewArrayExpression Update(IEnumerable<
Expression
> expressions) {
90
return
Expression
.NewArrayInit(Type.GetElementType(), expressions);
92
return
Expression
.NewArrayBounds(Type.GetElementType(), expressions);
97
internal NewArrayInitExpression(Type type, ReadOnlyCollection<
Expression
> expressions)
103
/// Returns the node type of this <see cref="
Expression
" />. (Inherited from <see cref="
Expression
" />.)
112
internal NewArrayBoundsExpression(Type type, ReadOnlyCollection<
Expression
> expressions)
117
/// Returns the node type of this <see cref="
Expression
" />. (Inherited from <see cref="
Expression
" />.)
136
public static NewArrayExpression NewArrayInit(Type type, params
Expression
[] initializers) {
137
return NewArrayInit(type, (IEnumerable<
Expression
>)initializers);
146
public static NewArrayExpression NewArrayInit(Type type, IEnumerable<
Expression
> initializers) {
153
ReadOnlyCollection<
Expression
> initializerList = initializers.ToReadOnly();
155
Expression
[] newList = null;
157
Expression
expr = initializerList[i];
165
newList = new
Expression
[initializerList.Count];
176
initializerList = new TrueReadOnlyCollection<
Expression
>(newList);
193
public static NewArrayExpression NewArrayBounds(Type type, params
Expression
[] bounds) {
194
return NewArrayBounds(type, (IEnumerable<
Expression
>)bounds);
204
public static NewArrayExpression NewArrayBounds(Type type, IEnumerable<
Expression
> bounds) {
212
ReadOnlyCollection<
Expression
> boundsList = bounds.ToReadOnly();
218
Expression
expr = boundsList[i];
Microsoft\Scripting\Ast\NewExpression.cs (30)
38
[DebuggerTypeProxy(typeof(
Expression
.NewExpressionProxy))]
42
private IList<
Expression
> _arguments;
45
internal NewExpression(ConstructorInfo constructor, IList<
Expression
> arguments, ReadOnlyCollection<MemberInfo> members) {
52
/// Gets the static type of the expression that this <see cref="
Expression
" /> represents. (Inherited from <see cref="
Expression
"/>.)
60
/// Returns the node type of this <see cref="
Expression
" />. (Inherited from <see cref="
Expression
" />.)
77
public ReadOnlyCollection<
Expression
> Arguments {
81
Expression
IArgumentProvider.GetArgument(int index) {
101
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
112
public NewExpression Update(IEnumerable<
Expression
> arguments) {
117
return
Expression
.New(Constructor, arguments, Members);
119
return
Expression
.New(Constructor, arguments);
126
internal NewValueTypeExpression(Type type, ReadOnlyCollection<
Expression
> arguments, ReadOnlyCollection<MemberInfo> members)
144
return New(constructor, (IEnumerable<
Expression
>)null);
152
/// <param name="arguments">An array of <see cref="
Expression
"/> objects to use to populate the Arguments collection.</param>
154
public static NewExpression New(ConstructorInfo constructor, params
Expression
[] arguments) {
155
return New(constructor, (IEnumerable<
Expression
>)arguments);
163
/// <param name="arguments">An <see cref="IEnumerable{T}"/> of <see cref="
Expression
"/> objects to use to populate the Arguments collection.</param>
165
public static NewExpression New(ConstructorInfo constructor, IEnumerable<
Expression
> arguments) {
180
/// <param name="arguments">An <see cref="IEnumerable{T}"/> of <see cref="
Expression
"/> objects to use to populate the Arguments collection.</param>
183
public static NewExpression New(ConstructorInfo constructor, IEnumerable<
Expression
> arguments, IEnumerable<MemberInfo> members) {
196
/// <param name="arguments">An <see cref="IEnumerable{T}"/> of <see cref="
Expression
"/> objects to use to populate the Arguments collection.</param>
199
public static NewExpression New(ConstructorInfo constructor, IEnumerable<
Expression
> arguments, params MemberInfo[] members) {
222
return new NewValueTypeExpression(type, EmptyReadOnlyCollection<
Expression
>.Instance, null);
228
private static void ValidateNewArgs(ConstructorInfo constructor, ref ReadOnlyCollection<
Expression
> arguments, ref ReadOnlyCollection<MemberInfo> members) {
237
Expression
[] newArguments = null;
240
Expression
arg = arguments[i];
265
newArguments = new
Expression
[arguments.Count];
285
arguments = new TrueReadOnlyCollection<
Expression
>(newArguments);
Microsoft\Scripting\Ast\ParameterExpression.cs (6)
34
[DebuggerTypeProxy(typeof(
Expression
.ParameterExpressionProxy))]
85
/// Gets the static type of the expression that this <see cref="
Expression
" /> represents. (Inherited from <see cref="
Expression
"/>.)
93
/// Returns the node type of this <see cref="
Expression
" />. (Inherited from <see cref="
Expression
" />.)
123
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
Microsoft\Scripting\Ast\RuntimeVariablesExpression.cs (5)
34
[DebuggerTypeProxy(typeof(
Expression
.RuntimeVariablesExpressionProxy))]
44
/// Gets the static type of the expression that this <see cref="
Expression
" /> represents.
70
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
85
return
Expression
.RuntimeVariables(variables);
110
Expression
v = vars[i];
Microsoft\Scripting\Ast\SwitchCase.cs (15)
31
[DebuggerTypeProxy(typeof(
Expression
.SwitchCaseProxy))]
34
private readonly ReadOnlyCollection<
Expression
> _testValues;
35
private readonly
Expression
_body;
37
internal SwitchCase(
Expression
body, ReadOnlyCollection<
Expression
> testValues) {
45
public ReadOnlyCollection<
Expression
> TestValues {
52
public
Expression
Body {
72
public SwitchCase Update(IEnumerable<
Expression
> testValues,
Expression
body) {
76
return
Expression
.SwitchCase(body, testValues);
87
public static SwitchCase SwitchCase(
Expression
body, params
Expression
[] testValues) {
88
return SwitchCase(body, (IEnumerable<
Expression
>)testValues);
97
public static SwitchCase SwitchCase(
Expression
body, IEnumerable<
Expression
> testValues) {
Microsoft\Scripting\Ast\SwitchExpression.cs (25)
36
[DebuggerTypeProxy(typeof(
Expression
.SwitchExpressionProxy))]
40
private readonly
Expression
_switchValue;
42
private readonly
Expression
_defaultBody;
45
internal SwitchExpression(Type type,
Expression
switchValue,
Expression
defaultBody, MethodInfo comparison, ReadOnlyCollection<SwitchCase> cases) {
54
/// Gets the static type of the expression that this <see cref="
Expression
" /> represents.
73
public
Expression
SwitchValue {
87
public
Expression
DefaultBody {
101
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
124
public SwitchExpression Update(
Expression
switchValue, IEnumerable<SwitchCase> cases,
Expression
defaultBody) {
128
return
Expression
.Switch(Type, switchValue, defaultBody, Comparison, cases);
139
public static SwitchExpression Switch(
Expression
switchValue, params SwitchCase[] cases) {
150
public static SwitchExpression Switch(
Expression
switchValue,
Expression
defaultBody, params SwitchCase[] cases) {
162
public static SwitchExpression Switch(
Expression
switchValue,
Expression
defaultBody, MethodInfo comparison, params SwitchCase[] cases) {
175
public static SwitchExpression Switch(Type type,
Expression
switchValue,
Expression
defaultBody, MethodInfo comparison, params SwitchCase[] cases) {
187
public static SwitchExpression Switch(
Expression
switchValue,
Expression
defaultBody, MethodInfo comparison, IEnumerable<SwitchCase> cases) {
200
public static SwitchExpression Switch(Type type,
Expression
switchValue,
Expression
defaultBody, MethodInfo comparison, IEnumerable<SwitchCase> cases) {
250
var
firstTestValue = caseList[0].TestValues[0];
290
private static void ValidateSwitchCaseType(
Expression
@case, bool customType, Type resultType, string parameterName) {
Microsoft\Scripting\Ast\TryExpression.cs (33)
42
[DebuggerTypeProxy(typeof(
Expression
.TryExpressionProxy))]
46
private readonly
Expression
_body;
48
private readonly
Expression
_finally;
49
private readonly
Expression
_fault;
51
internal TryExpression(Type type,
Expression
body,
Expression
@finally,
Expression
fault, ReadOnlyCollection<CatchBlock> handlers) {
60
/// Gets the static type of the expression that this <see cref="
Expression
" /> represents. (Inherited from <see cref="
Expression
"/>.)
68
/// Returns the node type of this <see cref="
Expression
" />. (Inherited from <see cref="
Expression
" />.)
76
/// Gets the <see cref="
Expression
"/> representing the body of the try block.
78
public
Expression
Body {
90
/// Gets the <see cref="
Expression
"/> representing the finally block.
92
public
Expression
Finally {
97
/// Gets the <see cref="
Expression
"/> representing the fault block.
99
public
Expression
Fault {
106
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
120
public TryExpression Update(
Expression
body, IEnumerable<CatchBlock> handlers,
Expression
@finally,
Expression
fault) {
124
return
Expression
.MakeTry(Type, body, @finally, fault, handlers);
136
public static TryExpression TryFault(
Expression
body,
Expression
fault) {
146
public static TryExpression TryFinally(
Expression
body,
Expression
@finally) {
156
public static TryExpression TryCatch(
Expression
body, params CatchBlock[] handlers) {
167
public static TryExpression TryCatchFinally(
Expression
body,
Expression
@finally, params CatchBlock[] handlers) {
180
public static TryExpression MakeTry(Type type,
Expression
body,
Expression
@finally,
Expression
fault, IEnumerable<CatchBlock> handlers) {
202
private static void ValidateTryAndCatchHaveSameType(Type type,
Expression
tryBody, ReadOnlyCollection<CatchBlock> handlers) {
Microsoft\Scripting\Ast\TypeBinaryExpression.cs (42)
33
[DebuggerTypeProxy(typeof(
Expression
.TypeBinaryExpressionProxy))]
36
private readonly
Expression
_expression;
40
internal TypeBinaryExpression(
Expression
expression, Type typeOperand, ExpressionType nodeKind) {
66
public
Expression
Expression {
79
internal
Expression
ReduceTypeEqual() {
85
return
Expression
.Block(Expression,
Expression
.Constant(cType == _typeOperand.GetNonNullableType()));
97
return
Expression
.NotEqual(Expression,
Expression
.Constant(null, Expression.Type));
99
return
Expression
.ReferenceNotEqual(Expression,
Expression
.Constant(null, Expression.Type));
110
parameter =
Expression
.Parameter(typeof(object));
113
var
expression = Expression;
115
expression =
Expression
.Convert(expression, typeof(object));
118
return
Expression
.Block(
120
Expression
.Assign(parameter, expression),
126
private
Expression
ByValParameterTypeEqual(ParameterExpression value) {
127
Expression
getType =
Expression
.Call(value, typeof(object).GetMethod("GetType"));
135
var temp =
Expression
.Parameter(typeof(Type));
136
getType =
Expression
.Block(new[] { temp },
Expression
.Assign(temp, getType), temp);
142
return
Expression
.AndAlso(
143
Expression
.ReferenceNotEqual(value,
Expression
.Constant(null)),
144
Expression
.ReferenceEqual(
146
Expression
.Constant(_typeOperand.GetNonNullableType(), typeof(Type))
151
private
Expression
ReduceConstantTypeEqual() {
155
return
Expression
.Constant(false);
157
return
Expression
.Constant(_typeOperand.GetNonNullableType() == ce.Value.GetType());
166
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
177
public TypeBinaryExpression Update(
Expression
expression) {
182
return
Expression
.TypeIs(expression, TypeOperand);
184
return
Expression
.TypeEqual(expression, TypeOperand);
192
/// <param name="expression">An <see cref="
Expression
"/> to set the <see cref="
Expression
"/> property equal to.</param>
194
/// <returns>A <see cref="TypeBinaryExpression"/> for which the <see cref="NodeType"/> property is equal to <see cref="TypeIs"/> and for which the <see cref="
Expression
"/> and <see cref="TypeBinaryExpression.TypeOperand"/> properties are set to the specified values.</returns>
195
public static TypeBinaryExpression TypeIs(
Expression
expression, Type type) {
206
/// <param name="expression">An <see cref="
Expression
"/> to set the <see cref="
Expression
"/> property equal to.</param>
208
/// <returns>A <see cref="TypeBinaryExpression"/> for which the <see cref="NodeType"/> property is equal to <see cref="TypeEqual"/> and for which the <see cref="
Expression
"/> and <see cref="TypeBinaryExpression.TypeOperand"/> properties are set to the specified values.</returns>
209
public static TypeBinaryExpression TypeEqual(
Expression
expression, Type type) {
Microsoft\Scripting\Ast\TypeUtils.cs (1)
685
private static readonly Assembly _systemCore = typeof(
Expression
).Assembly;
Microsoft\Scripting\Ast\UnaryExpression.cs (73)
36
[DebuggerTypeProxy(typeof(
Expression
.UnaryExpressionProxy))]
39
private readonly
Expression
_operand;
44
internal UnaryExpression(ExpressionType nodeType,
Expression
expression, Type type, MethodInfo method) {
52
/// Gets the static type of the expression that this <see cref="
Expression
" /> represents. (Inherited from <see cref="
Expression
"/>.)
60
/// Returns the node type of this <see cref="
Expression
" />. (Inherited from <see cref="
Expression
" />.)
71
public
Expression
Operand {
115
protected internal override
Expression
Accept(ExpressionVisitor visitor) {
142
public override
Expression
Reduce() {
160
private UnaryExpression FunctionalOp(
Expression
operand) {
170
private
Expression
ReduceVariable() {
191
private
Expression
ReduceMember() {
230
private
Expression
ReduceIndex() {
246
var block = new
Expression
[count + (prefix ? 2 : 4)];
255
var
arg = index.Arguments[i - 1];
260
index = MakeIndex(temps[0], index.Indexer, new TrueReadOnlyCollection<
Expression
>(args));
273
return Block(new TrueReadOnlyCollection<ParameterExpression>(temps), new TrueReadOnlyCollection<
Expression
>(block));
283
public UnaryExpression Update(
Expression
operand) {
287
return
Expression
.MakeUnary(NodeType, operand, Type, Method);
297
/// <param name="operand">An <see cref="
Expression
"></see> that represents the operand.</param>
302
public static UnaryExpression MakeUnary(ExpressionType unaryType,
Expression
operand, Type type) {
310
/// <param name="operand">An <see cref="
Expression
"></see> that represents the operand.</param>
317
public static UnaryExpression MakeUnary(ExpressionType unaryType,
Expression
operand, Type type, MethodInfo method) {
364
private static UnaryExpression GetUserDefinedUnaryOperatorOrThrow(ExpressionType unaryType, string name,
Expression
operand) {
373
private static UnaryExpression GetUserDefinedUnaryOperator(ExpressionType unaryType, string name,
Expression
operand) {
393
private static UnaryExpression GetMethodBasedUnaryOperator(ExpressionType unaryType,
Expression
operand, MethodInfo method) {
413
private static UnaryExpression GetUserDefinedCoercionOrThrow(ExpressionType coercionType,
Expression
expression, Type convertToType) {
421
private static UnaryExpression GetUserDefinedCoercion(ExpressionType coercionType,
Expression
expression, Type convertToType) {
430
private static UnaryExpression GetMethodBasedCoercionOperator(ExpressionType unaryType,
Expression
operand, Type convertToType, MethodInfo method) {
452
/// <param name="expression">An <see cref="
Expression
"></see> to set the <see cref="P:UnaryExpression.Operand"></see> property equal to.</param>
456
public static UnaryExpression Negate(
Expression
expression) {
463
/// <param name="expression">An <see cref="
Expression
"></see> to set the <see cref="P:UnaryExpression.Operand"></see> property equal to.</param>
469
public static UnaryExpression Negate(
Expression
expression, MethodInfo method) {
483
/// <param name="expression">An <see cref="
Expression
"></see> to set the <see cref="UnaryExpression.Operand"></see> property equal to.</param>
484
/// <returns>A <see cref="UnaryExpression"></see> that has the <see cref="
Expression
.NodeType"></see> property equal to <see cref="ExpressionType.UnaryPlus"></see> and the <see cref="UnaryExpression.Operand"></see> property set to the specified value.</returns>
487
public static UnaryExpression UnaryPlus(
Expression
expression) {
494
/// <param name="expression">An <see cref="
Expression
"></see> to set the <see cref="UnaryExpression.Operand"></see> property equal to.</param>
496
/// <returns>A <see cref="UnaryExpression"></see> that has the <see cref="
Expression
.NodeType"></see> property equal to <see cref="ExpressionType.UnaryPlus"></see> and the <see cref="UnaryExpression.Operand"></see> and <see cref="UnaryExpression.Method"></see>property set to the specified value.</returns>
500
public static UnaryExpression UnaryPlus(
Expression
expression, MethodInfo method) {
517
public static UnaryExpression NegateChecked(
Expression
expression) {
531
public static UnaryExpression NegateChecked(
Expression
expression, MethodInfo method) {
548
public static UnaryExpression Not(
Expression
expression) {
562
public static UnaryExpression Not(
Expression
expression, MethodInfo method) {
582
public static UnaryExpression IsFalse(
Expression
expression) {
592
public static UnaryExpression IsFalse(
Expression
expression, MethodInfo method) {
608
public static UnaryExpression IsTrue(
Expression
expression) {
618
public static UnaryExpression IsTrue(
Expression
expression, MethodInfo method) {
634
public static UnaryExpression OnesComplement(
Expression
expression) {
644
public static UnaryExpression OnesComplement(
Expression
expression, MethodInfo method) {
661
public static UnaryExpression TypeAs(
Expression
expression, Type type) {
678
public static UnaryExpression Unbox(
Expression
expression, Type type) {
696
public static UnaryExpression Convert(
Expression
expression, Type type) {
711
public static UnaryExpression Convert(
Expression
expression, Type type, MethodInfo method) {
733
public static UnaryExpression ConvertChecked(
Expression
expression, Type type) {
748
public static UnaryExpression ConvertChecked(
Expression
expression, Type type, MethodInfo method) {
772
public static UnaryExpression ArrayLength(
Expression
array) {
788
public static UnaryExpression Quote(
Expression
expression) {
820
public static UnaryExpression Throw(
Expression
value) {
830
public static UnaryExpression Throw(
Expression
value, Type type) {
846
public static UnaryExpression Increment(
Expression
expression) {
856
public static UnaryExpression Increment(
Expression
expression, MethodInfo method) {
872
public static UnaryExpression Decrement(
Expression
expression) {
882
public static UnaryExpression Decrement(
Expression
expression, MethodInfo method) {
899
public static UnaryExpression PreIncrementAssign(
Expression
expression) {
911
public static UnaryExpression PreIncrementAssign(
Expression
expression, MethodInfo method) {
921
public static UnaryExpression PreDecrementAssign(
Expression
expression) {
932
public static UnaryExpression PreDecrementAssign(
Expression
expression, MethodInfo method) {
942
public static UnaryExpression PostIncrementAssign(
Expression
expression) {
953
public static UnaryExpression PostIncrementAssign(
Expression
expression, MethodInfo method) {
963
public static UnaryExpression PostDecrementAssign(
Expression
expression) {
974
public static UnaryExpression PostDecrementAssign(
Expression
expression, MethodInfo method) {
978
private static UnaryExpression MakeOpAssignUnary(ExpressionType kind,
Expression
expression, MethodInfo method) {
Microsoft\Scripting\Compiler\ConstantCheck.cs (2)
35
internal static bool IsNull(
Expression
e) {
63
private static AnalyzeTypeIsResult AnalyzeTypeIs(
Expression
operand, Type testType) {
Microsoft\Scripting\Compiler\DelegateHelpers.Generated.cs (4)
48
public Type MakeDelegateType(Type retType, params
Expression
[] args) {
49
return MakeDelegateType(retType, (IList<
Expression
>)args);
52
public Type MakeDelegateType(Type retType, IList<
Expression
> args) {
97
internal static Type MakeCallSiteDelegate(ReadOnlyCollection<
Expression
> types, Type returnType) {
Microsoft\Scripting\Compiler\ExpressionQuoter.cs (18)
39
public static
Expression
Quote(
Expression
expression, object hoistedLocals, object[] locals) {
77
protected internal override
Expression
VisitLambda<T>(Expression<T> node) {
79
Expression
b = Visit(node.Body);
84
return
Expression
.Lambda<T>(b, node.Name, node.TailCall, node.Parameters);
87
protected internal override
Expression
VisitBlock(BlockExpression node) {
98
return
Expression
.Block(node.Variables, b);
105
Expression
b = Visit(node.Body);
106
Expression
f = Visit(node.Filter);
113
return
Expression
.MakeCatchBlock(node.Test, node.Variable, b, f);
116
protected internal override
Expression
VisitRuntimeVariables(RuntimeVariablesExpression node) {
137
var boxesConst =
Expression
.Constant(new RuntimeVariables(boxes.ToArray()), typeof(IRuntimeVariables));
144
return
Expression
.Call(
146
Expression
.RuntimeVariables(new TrueReadOnlyCollection<ParameterExpression>(vars.ToArray())),
148
Expression
.Constant(indexes)
152
protected internal override
Expression
VisitParameter(ParameterExpression node) {
157
return
Expression
.Field(
Expression
.Constant(box), "Value");
Microsoft\Scripting\Compiler\HoistedLocals.cs (5)
67
internal readonly ReadOnlyDictionary<
Expression
, int> Indexes;
82
Dictionary<
Expression
, int> indexes = new Dictionary<
Expression
, int>(vars.Count);
87
SelfVariable =
Expression
.Variable(typeof(object[]), null);
90
Indexes = new ReadOnlyDictionary<
Expression
, int>(indexes);
Microsoft\Scripting\Compiler\LambdaCompiler.Address.cs (5)
29
private void EmitAddress(
Expression
node, Type type) {
37
private void EmitAddress(
Expression
node, Type type, CompilationFlags flags) {
206
private void EmitExpressionAddress(
Expression
node, Type type) {
220
private WriteBack EmitAddressWriteBack(
Expression
node, Type type) {
299
foreach (
var
arg in node.Arguments) {
Microsoft\Scripting\Compiler\LambdaCompiler.Binary.cs (8)
34
private void EmitBinaryExpression(
Expression
expr) {
38
private void EmitBinaryExpression(
Expression
expr, CompilationFlags flags) {
81
private void EmitNullEquality(ExpressionType op,
Expression
e, bool isLiftedToNull) {
102
ParameterExpression p1 =
Expression
.Variable(TypeUtils.GetNonNullableType(b.Left.Type), null);
103
ParameterExpression p2 =
Expression
.Variable(TypeUtils.GetNonNullableType(b.Right.Type), null);
104
MethodCallExpression mc =
Expression
.Call(null, b.Method, p1, p2);
127
var arguments = new
Expression
[] { b.Left, b.Right };
131
EmitMethodCallExpression(
Expression
.Call(null, b.Method, b.Left, b.Right), flags);
Microsoft\Scripting\Compiler\LambdaCompiler.ControlFlow.cs (7)
62
private void EmitLabelExpression(
Expression
expr, CompilationFlags flags) {
99
private void EmitGotoExpression(
Expression
expr, CompilationFlags flags) {
131
private void EmitUnreachable(
Expression
node, CompilationFlags flags) {
137
private bool TryPushLabelBlock(
Expression
node) {
209
private void DefineBlockLabels(
Expression
node) {
215
Expression
e = block.GetExpression(i);
228
var
expression = lambda.Body;
Microsoft\Scripting\Compiler\LambdaCompiler.cs (3)
317
return
Expression
.Field(
Expression
.Constant(new StrongBox<T>(default(T))), "Value");
319
return
Expression
.Field(null, CreateStaticField(name, typeof(T)));
Microsoft\Scripting\Compiler\LambdaCompiler.Expressions.cs (37)
82
internal void EmitExpression(
Expression
node) {
90
private void EmitExpressionAsVoid(
Expression
node) {
94
private void EmitExpressionAsVoid(
Expression
node, CompilationFlags flags) {
129
private void EmitExpressionAsType(
Expression
node, Type type, CompilationFlags flags) {
149
private CompilationFlags EmitExpressionStart(
Expression
node) {
166
private void EmitInvocationExpression(
Expression
expr, CompilationFlags flags) {
182
expr =
Expression
.Call(expr, expr.Type.GetMethod("Compile", new Type[0]));
184
expr =
Expression
.Call(expr, expr.Type.GetMethod("Invoke"), node.Arguments);
218
private void EmitIndexExpression(
Expression
expr) {
229
foreach (
var
arg in node.Arguments) {
249
foreach (
var
arg in index.Arguments) {
304
private void EmitMethodCallExpression(
Expression
expr, CompilationFlags flags) {
310
private void EmitMethodCallExpression(
Expression
expr) {
314
private void EmitMethodCall(
Expression
obj, MethodInfo method, IArgumentProvider methodCallExpr) {
318
private void EmitMethodCall(
Expression
obj, MethodInfo method, IArgumentProvider methodCallExpr, CompilationFlags flags) {
439
Expression
argument = args.GetArgument(i - skipParameters);
464
private void EmitConstantExpression(
Expression
expr) {
480
private void EmitDynamicExpression(
Expression
expr) {
514
private void EmitNewExpression(
Expression
expr) {
532
private void EmitTypeBinaryExpression(
Expression
expr) {
610
private void EmitAssignBinaryExpression(
Expression
expr) {
630
private void EmitParameterExpression(
Expression
expr) {
638
private void EmitLambdaExpression(
Expression
expr) {
643
private void EmitRuntimeVariablesExpression(
Expression
expr) {
686
private void EmitMemberExpression(
Expression
expr) {
717
private void EmitInstance(
Expression
instance, Type type) {
727
private void EmitNewArrayExpression(
Expression
expr) {
739
ReadOnlyCollection<
Expression
> bounds = node.Expressions;
741
Expression
x = bounds[i];
749
private void EmitDebugInfoExpression(
Expression
expr) {
767
private static void EmitExtensionExpression(
Expression
expr) {
773
private void EmitListInitExpression(
Expression
expr) {
777
private void EmitMemberInitExpression(
Expression
expr) {
922
internal static void ValidateLift(IList<ParameterExpression> variables, IList<
Expression
> arguments) {
937
private void EmitLift(ExpressionType nodeType, Type resultType, MethodCallExpression mc, ParameterExpression[] paramList,
Expression
[] argList) {
951
Expression
arg = argList[i];
1026
Expression
arg = argList[i];
Microsoft\Scripting\Compiler\LambdaCompiler.Generated.cs (2)
28
private void EmitExpression(
Expression
node, CompilationFlags flags) {
34
_guard.RunOnEmptyStack((LambdaCompiler @this,
Expression
n, CompilationFlags f) => @this.EmitExpression(n, f), this, node, flags);
Microsoft\Scripting\Compiler\LambdaCompiler.Logical.cs (9)
36
private void EmitConditionalExpression(
Expression
expr, CompilationFlags flags) {
63
private static bool NotEmpty(
Expression
node) {
76
private static bool Significant(
Expression
node) {
94
private void EmitCoalesceBinaryExpression(
Expression
expr) {
320
private void EmitAndAlsoBinaryExpression(
Expression
expr, CompilationFlags flags) {
436
private void EmitOrElseBinaryExpression(
Expression
expr, CompilationFlags flags) {
478
private void EmitExpressionAndBranch(bool branchValue,
Expression
node, Label label) {
570
private static
Expression
GetEqualityOperand(
Expression
expression) {
Microsoft\Scripting\Compiler\LambdaCompiler.Statements.cs (39)
34
private void EmitBlockExpression(
Expression
expr, CompilationFlags flags) {
47
var
e = node.GetExpression(index);
48
var
next = node.GetExpression(index + 1);
131
private void EmitDefaultExpression(
Expression
expr) {
139
private void EmitLoopExpression(
Expression
expr) {
159
private void EmitSwitchExpression(
Expression
expr, CompilationFlags flags) {
177
var switchValue =
Expression
.Parameter(node.SwitchValue.Type, "switchValue");
178
var testValue =
Expression
.Parameter(GetTestValueType(node), "testValue");
190
foreach (
Expression
test in node.Cases[i].TestValues) {
196
EmitExpressionAndBranch(true,
Expression
.Equal(switchValue, testValue, false, node.Comparison), labels[i]);
565
foreach (
Expression
t in c.TestValues) {
589
initializers.Add(
Expression
.ElementInit(add, t,
Expression
.Constant(i)));
594
cases.Add(
Expression
.SwitchCase(node.Cases[i].Body,
Expression
.Constant(i)));
603
Expression
dictInit =
Expression
.Condition(
604
Expression
.Equal(dictField,
Expression
.Constant(null, dictField.Type)),
605
Expression
.Assign(
607
Expression
.ListInit(
608
Expression
.New(
610
Expression
.Constant(initializers.Count)
639
var switchValue =
Expression
.Variable(typeof(string), "switchValue");
640
var switchIndex =
Expression
.Variable(typeof(int), "switchIndex");
641
var reduced =
Expression
.Block(
643
Expression
.Assign(switchValue, node.SwitchValue),
644
Expression
.IfThenElse(
645
Expression
.Equal(switchValue,
Expression
.Constant(null, typeof(string))),
646
Expression
.Assign(switchIndex,
Expression
.Constant(nullCase)),
647
Expression
.IfThenElse(
648
Expression
.Call(dictInit, "TryGetValue", null, switchValue, switchIndex),
649
Expression
.Empty(),
650
Expression
.Assign(switchIndex,
Expression
.Constant(-1))
653
Expression
.Switch(node.Type, switchIndex, node.DefaultBody, null, cases)
697
private void EmitTryExpression(
Expression
expr) {
Microsoft\Scripting\Compiler\LambdaCompiler.Unary.cs (13)
34
private void EmitQuoteUnaryExpression(
Expression
expr) {
51
if (quote.Type != typeof(
Expression
)) {
57
private void EmitThrowUnaryExpression(
Expression
expr) {
74
private void EmitUnaryExpression(
Expression
expr, CompilationFlags flags) {
270
private void EmitUnboxUnaryExpression(
Expression
expr) {
279
private void EmitConvertUnaryExpression(
Expression
expr, CompilationFlags flags) {
309
UnaryExpression e =
Expression
.Convert(
310
Expression
.Call(
312
Expression
.Convert(node.Operand, pis[0].ParameterType)
337
ParameterExpression v =
Expression
.Variable(TypeUtils.GetNonNullableType(node.Operand.Type), null);
338
MethodCallExpression mc =
Expression
.Call(node.Method, v);
341
EmitLift(node.NodeType, resultType, mc, new ParameterExpression[] { v }, new
Expression
[] { node.Operand });
344
EmitMethodCallExpression(
Expression
.Call(node.Method, node.Operand), flags);
Microsoft\Scripting\Compiler\StackSpiller.Bindings.cs (34)
47
internal abstract
Expression
AsExpression(
Expression
target);
90
return
Expression
.MemberBind(_binding.Member, new TrueReadOnlyCollection<MemberBinding>(newBindings));
95
internal override
Expression
AsExpression(
Expression
target) {
101
MemberExpression member =
Expression
.MakeMemberAccess(target, _binding.Member);
104
Expression
[] block = new
Expression
[_bindings.Count + 2];
105
block[0] =
Expression
.Assign(memberTemp, member);
114
block[_bindings.Count + 1] =
Expression
.Block(
116
Expression
.Assign(
Expression
.MakeMemberAccess(target, _binding.Member), memberTemp)
119
block[_bindings.Count + 1] =
Expression
.Empty();
157
newInits[i] =
Expression
.ElementInit(_inits[i].AddMethod, cr[0, -1]);
160
return
Expression
.ListBind(_binding.Member, new TrueReadOnlyCollection<ElementInit>(newInits));
165
internal override
Expression
AsExpression(
Expression
target) {
171
MemberExpression member =
Expression
.MakeMemberAccess(target, _binding.Member);
174
Expression
[] block = new
Expression
[_inits.Count + 2];
175
block[0] =
Expression
.Assign(memberTemp, member);
179
Result add = cr.Finish(
Expression
.Call(memberTemp, _inits[i].AddMethod, cr[0, -1]));
185
block[_inits.Count + 1] =
Expression
.Block(
187
Expression
.Assign(
Expression
.MakeMemberAccess(target, _binding.Member), memberTemp)
190
block[_inits.Count + 1] =
Expression
.Empty();
197
Expression
_rhs;
212
return
Expression
.Bind(_binding.Member, _rhs);
217
internal override
Expression
AsExpression(
Expression
target) {
220
MemberExpression member =
Expression
.MakeMemberAccess(target, _binding.Member);
224
Expression
.Assign(memberTemp, _rhs),
225
Expression
.Assign(member, memberTemp),
226
Expression
.Empty()
Microsoft\Scripting\Compiler\StackSpiller.cs (64)
66
internal readonly
Expression
Node;
68
internal Result(RewriteAction action,
Expression
node) {
118
Expression
newBody = body.Node;
120
newBody =
Expression
.Block(_tm.Temps, newBody);
133
private static void VerifyRewrite(Result result,
Expression
node) {
157
private Result RewriteExpressionFreeTemps(
Expression
expression, Stack stack) {
166
private Result RewriteDynamicExpression(
Expression
expr, Stack stack) {
207
private Result RewriteLogicalBinaryExpression(
Expression
expr, Stack stack) {
236
private Result RewriteReducibleExpression(
Expression
expr, Stack stack) {
243
private Result RewriteBinaryExpression(
Expression
expr, Stack stack) {
274
node =
Expression
.Assign(node.Left, right.Node);
279
private Result RewriteAssignBinaryExpression(
Expression
expr, Stack stack) {
297
node =
Expression
.Assign(node.Left.ReduceExtensions(), node.Right);
305
private static Result RewriteLambdaExpression(
Expression
expr, Stack stack) {
319
private Result RewriteConditionalExpression(
Expression
expr, Stack stack) {
330
expr =
Expression
.Condition(test.Node, ifTrue.Node, ifFalse.Node, node.Type);
365
private Result RewriteMemberExpression(
Expression
expr, Stack stack) {
383
private Result RewriteIndexExpression(
Expression
expr, Stack stack) {
409
private Result RewriteMethodCallExpression(
Expression
expr, Stack stack) {
429
private Result RewriteNewArrayExpression(
Expression
expr, Stack stack) {
448
expr =
Expression
.NewArrayInit(element, cr[0, -1]);
450
expr =
Expression
.NewArrayBounds(element, cr[0, -1]);
458
private Result RewriteInvocationExpression(
Expression
expr, Stack stack) {
471
RequireNoRefArgs(
Expression
.GetInvokeMethod(node.Expression));
495
RequireNoRefArgs(
Expression
.GetInvokeMethod(node.Expression));
502
private Result RewriteNewExpression(
Expression
expr, Stack stack) {
518
private Result RewriteTypeBinaryExpression(
Expression
expr, Stack stack) {
524
expr =
Expression
.TypeIs(expression.Node, node.TypeOperand);
526
expr =
Expression
.TypeEqual(expression.Node, node.TypeOperand);
533
private Result RewriteThrowUnaryExpression(
Expression
expr, Stack stack) {
549
expr =
Expression
.Throw(value.Node, node.Type);
556
private Result RewriteUnaryExpression(
Expression
expr, Stack stack) {
576
private Result RewriteListInitExpression(
Expression
expr, Stack stack) {
581
Expression
rewrittenNew = newResult.Node;
609
newInits[i] =
Expression
.ElementInit(inits[i].AddMethod, cr[0, -1]);
612
expr =
Expression
.ListInit((NewExpression)rewrittenNew, new TrueReadOnlyCollection<ElementInit>(newInits));
618
Expression
[] comma = new
Expression
[inits.Count + 2];
619
comma[0] =
Expression
.Assign(tempNew, rewrittenNew);
623
Result add = cr.Finish(
Expression
.Call(tempNew, inits[i].AddMethod, cr[0, -1]));
637
private Result RewriteMemberInitExpression(
Expression
expr, Stack stack) {
642
Expression
rewrittenNew = result.Node;
663
expr =
Expression
.MemberInit((NewExpression)rewrittenNew, new TrueReadOnlyCollection<MemberBinding>(newBindings));
669
Expression
[] comma = new
Expression
[bindings.Count + 2];
670
comma[0] =
Expression
.Assign(tempNew, rewrittenNew);
673
Expression
initExpr = cr.AsExpression(tempNew);
690
private Result RewriteBlockExpression(
Expression
expr, Stack stack) {
695
Expression
[] clone = null;
697
Expression
expression = node.GetExpression(i);
720
private Result RewriteLabelExpression(
Expression
expr, Stack stack) {
725
expr =
Expression
.Label(node.Target, expression.Node);
731
private Result RewriteLoopExpression(
Expression
expr, Stack stack) {
757
private Result RewriteGotoExpression(
Expression
expr, Stack stack) {
772
expr =
Expression
.MakeGoto(node.Kind, node.Target, value.Node, node.Type);
778
private Result RewriteSwitchExpression(
Expression
expr, Stack stack) {
790
Expression
[] cloneTests = null;
791
ReadOnlyCollection<
Expression
> testValues = @case.TestValues;
813
testValues = new ReadOnlyCollection<
Expression
>(cloneTests);
844
private Result RewriteTryExpression(
Expression
expr, Stack stack) {
860
Expression
filter = handler.Filter;
875
handler =
Expression
.MakeCatchBlock(handler.Test, handler.Variable, rbody.Node, filter);
910
private Result RewriteExtensionExpression(
Expression
expr, Stack stack) {
977
private static void RequireNotRefInstance(
Expression
instance) {
Microsoft\Scripting\Compiler\StackSpiller.Generated.cs (2)
36
private Result RewriteExpression(
Expression
node, Stack stack) {
46
return _guard.RunOnEmptyStack((StackSpiller @this,
Expression
n, Stack s) => @this.RewriteExpression(n, s), this, node, stack);
Microsoft\Scripting\Compiler\StackSpiller.Temps.cs (25)
68
temp =
Expression
.Variable(type, "$temp$" + _temp++);
132
private readonly
Expression
[] _expressions;
134
private List<
Expression
> _comma;
142
_expressions = new
Expression
[count];
145
internal void Add(
Expression
node) {
161
internal void Add(IList<
Expression
> expressions) {
179
Expression
[] clone = _expressions;
181
List<
Expression
> comma = new List<
Expression
>(count + 1);
184
Expression
temp;
203
internal Result Finish(
Expression
expr) {
215
internal
Expression
this[int index] {
225
internal
Expression
[] this[int first, int last] {
240
Expression
[] clone = new
Expression
[count];
271
private ParameterExpression ToTemp(
Expression
expression, out
Expression
save) {
273
save =
Expression
.Assign(temp, expression);
282
private static
Expression
MakeBlock(params
Expression
[] expressions) {
283
return MakeBlock((IList<
Expression
>)expressions);
291
private static
Expression
MakeBlock(IList<
Expression
> expressions) {
301
internal SpilledExpressionBlock(IList<
Expression
> expressions)
304
internal override BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression> variables,
Expression
[] args) {
Microsoft\Scripting\Compiler\VariableBinder.cs (14)
50
public override
Expression
Visit(
Expression
node)
57
return _guard.RunOnEmptyStack((VariableBinder @this,
Expression
e) => @this.Visit(e), this, node);
63
protected internal override
Expression
VisitConstant(ConstantExpression node) {
79
protected internal override
Expression
VisitUnary(UnaryExpression node) {
91
protected internal override
Expression
VisitLambda<T>(Expression<T> node) {
100
protected internal override
Expression
VisitInvocation(InvocationExpression node) {
117
protected internal override
Expression
VisitBlock(BlockExpression node) {
142
private ReadOnlyCollection<
Expression
> MergeScopes(
Expression
node) {
143
ReadOnlyCollection<
Expression
> body;
146
body = new ReadOnlyCollection<
Expression
>(new[] { lambda.Body });
183
protected internal override
Expression
VisitParameter(ParameterExpression node) {
215
protected internal override
Expression
VisitRuntimeVariables(RuntimeVariablesExpression node) {
System\Linq\Expressions\ExpressionVisitor.cs (57)
18
internal virtual
Expression
Visit(
Expression
exp) {
101
ReadOnlyCollection<
Expression
> arguments = this.VisitExpressionList(initializer.Arguments);
103
return
Expression
.ElementInit(initializer.AddMethod, arguments);
108
internal virtual
Expression
VisitUnary(UnaryExpression u) {
109
Expression
operand = this.Visit(u.Operand);
111
return
Expression
.MakeUnary(u.NodeType, operand, u.Type, u.Method);
116
internal virtual
Expression
VisitBinary(BinaryExpression b) {
117
Expression
left = this.Visit(b.Left);
118
Expression
right = this.Visit(b.Right);
119
Expression
conversion = this.Visit(b.Conversion);
122
return
Expression
.Coalesce(left, right, conversion as LambdaExpression);
124
return
Expression
.MakeBinary(b.NodeType, left, right, b.IsLiftedToNull, b.Method);
129
internal virtual
Expression
VisitTypeIs(TypeBinaryExpression b) {
130
Expression
expr = this.Visit(b.Expression);
132
return
Expression
.TypeIs(expr, b.TypeOperand);
137
internal virtual
Expression
VisitConstant(ConstantExpression c) {
141
internal virtual
Expression
VisitConditional(ConditionalExpression c) {
142
Expression
test = this.Visit(c.Test);
143
Expression
ifTrue = this.Visit(c.IfTrue);
144
Expression
ifFalse = this.Visit(c.IfFalse);
146
return
Expression
.Condition(test, ifTrue, ifFalse);
151
internal virtual
Expression
VisitParameter(ParameterExpression p) {
155
internal virtual
Expression
VisitMemberAccess(MemberExpression m) {
156
Expression
exp = this.Visit(m.Expression);
158
return
Expression
.MakeMemberAccess(exp, m.Member);
163
internal virtual
Expression
VisitMethodCall(MethodCallExpression m) {
164
Expression
obj = this.Visit(m.Object);
165
IEnumerable<
Expression
> args = this.VisitExpressionList(m.Arguments);
167
return
Expression
.Call(obj, m.Method, args);
172
internal virtual ReadOnlyCollection<
Expression
> VisitExpressionList(ReadOnlyCollection<
Expression
> original) {
173
List<
Expression
> list = null;
175
Expression
p = this.Visit(original[i]);
180
list = new List<
Expression
>(n);
193
Expression
e = this.Visit(assignment.Expression);
195
return
Expression
.Bind(assignment.Member, e);
203
return
Expression
.MemberBind(binding.Member, bindings);
211
return
Expression
.ListBind(binding.Member, initializers);
261
internal virtual
Expression
VisitLambda(LambdaExpression lambda)
263
Expression
body = this.Visit(lambda.Body);
265
return
Expression
.Lambda(lambda.Type, body, lambda.Parameters);
271
IEnumerable<
Expression
> args = this.VisitExpressionList(nex.Arguments);
274
return
Expression
.New(nex.Constructor, args, nex.Members);
276
return
Expression
.New(nex.Constructor, args);
281
internal virtual
Expression
VisitMemberInit(MemberInitExpression init) {
285
return
Expression
.MemberInit(n, bindings);
290
internal virtual
Expression
VisitListInit(ListInitExpression init) {
294
return
Expression
.ListInit(n, initializers);
299
internal virtual
Expression
VisitNewArray(NewArrayExpression na) {
300
IEnumerable<
Expression
> exprs = this.VisitExpressionList(na.Expressions);
303
return
Expression
.NewArrayInit(na.Type.GetElementType(), exprs);
306
return
Expression
.NewArrayBounds(na.Type.GetElementType(), exprs);
312
internal virtual
Expression
VisitInvocation(InvocationExpression iv) {
313
IEnumerable<
Expression
> args = this.VisitExpressionList(iv.Arguments);
314
Expression
expr = this.Visit(iv.Expression);
316
return
Expression
.Invoke(expr, args);
System\Linq\IQueryable.cs (361)
16
Expression
Expression { get; }
27
IQueryable CreateQuery(
Expression
expression);
28
IQueryable<TElement> CreateQuery<TElement>(
Expression
expression);
30
object Execute(
Expression
expression);
32
TResult Execute<TResult>(
Expression
expression);
96
Expression
.Call(
99
new
Expression
[] { source.Expression,
Expression
.Quote(predicate) }
109
Expression
.Call(
112
new
Expression
[] { source.Expression,
Expression
.Quote(predicate) }
120
Expression
.Call(
123
new
Expression
[] { source.Expression }
131
Expression
.Call(
134
new
Expression
[] { source.Expression }
144
Expression
.Call(
147
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
157
Expression
.Call(
160
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
170
Expression
.Call(
173
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
183
Expression
.Call(
186
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
198
Expression
.Call(
201
new
Expression
[] { source.Expression,
Expression
.Quote(collectionSelector),
Expression
.Quote(resultSelector) }
213
Expression
.Call(
216
new
Expression
[] { source.Expression,
Expression
.Quote(collectionSelector),
Expression
.Quote(resultSelector) }
220
private static
Expression
GetSourceExpression<TSource>(IEnumerable<TSource> source) {
223
return
Expression
.Constant(source, typeof(IEnumerable<TSource>));
238
Expression
.Call(
241
new
Expression
[] {
244
Expression
.Quote(outerKeySelector),
245
Expression
.Quote(innerKeySelector),
246
Expression
.Quote(resultSelector)
263
Expression
.Call(
266
new
Expression
[] {
269
Expression
.Quote(outerKeySelector),
270
Expression
.Quote(innerKeySelector),
271
Expression
.Quote(resultSelector),
272
Expression
.Constant(comparer, typeof(IEqualityComparer<TKey>))
289
Expression
.Call(
292
new
Expression
[] {
295
Expression
.Quote(outerKeySelector),
296
Expression
.Quote(innerKeySelector),
297
Expression
.Quote(resultSelector) }
313
Expression
.Call(
316
new
Expression
[] {
319
Expression
.Quote(outerKeySelector),
320
Expression
.Quote(innerKeySelector),
321
Expression
.Quote(resultSelector),
322
Expression
.Constant(comparer, typeof(IEqualityComparer<TKey>)) }
333
Expression
.Call(
336
new
Expression
[] { source.Expression,
Expression
.Quote(keySelector) }
346
Expression
.Call(
349
new
Expression
[] { source.Expression,
Expression
.Quote(keySelector),
Expression
.Constant(comparer, typeof(IComparer<TKey>)) }
359
Expression
.Call(
362
new
Expression
[] { source.Expression,
Expression
.Quote(keySelector) }
372
Expression
.Call(
375
new
Expression
[] { source.Expression,
Expression
.Quote(keySelector),
Expression
.Constant(comparer, typeof(IComparer<TKey>)) }
385
Expression
.Call(
388
new
Expression
[] { source.Expression,
Expression
.Quote(keySelector) }
398
Expression
.Call(
401
new
Expression
[] { source.Expression,
Expression
.Quote(keySelector),
Expression
.Constant(comparer, typeof(IComparer<TKey>)) }
411
Expression
.Call(
414
new
Expression
[] { source.Expression,
Expression
.Quote(keySelector) }
424
Expression
.Call(
427
new
Expression
[] { source.Expression,
Expression
.Quote(keySelector),
Expression
.Constant(comparer, typeof(IComparer<TKey>)) }
435
Expression
.Call(
438
new
Expression
[] { source.Expression,
Expression
.Constant(count) }
448
Expression
.Call(
451
new
Expression
[] { source.Expression,
Expression
.Quote(predicate) }
461
Expression
.Call(
464
new
Expression
[] { source.Expression,
Expression
.Quote(predicate) }
472
Expression
.Call(
475
new
Expression
[] { source.Expression,
Expression
.Constant(count) }
485
Expression
.Call(
488
new
Expression
[] { source.Expression,
Expression
.Quote(predicate) }
498
Expression
.Call(
501
new
Expression
[] { source.Expression,
Expression
.Quote(predicate) }
511
Expression
.Call(
514
new
Expression
[] { source.Expression,
Expression
.Quote(keySelector) }
526
Expression
.Call(
529
new
Expression
[] { source.Expression,
Expression
.Quote(keySelector),
Expression
.Quote(elementSelector) }
539
Expression
.Call(
542
new
Expression
[] { source.Expression,
Expression
.Quote(keySelector),
Expression
.Constant(comparer, typeof(IEqualityComparer<TKey>)) }
554
Expression
.Call(
557
new
Expression
[] { source.Expression,
Expression
.Quote(keySelector),
Expression
.Quote(elementSelector),
Expression
.Constant(comparer, typeof(IEqualityComparer<TKey>)) }
572
Expression
.Call(
575
new
Expression
[] { source.Expression,
Expression
.Quote(keySelector),
Expression
.Quote(elementSelector),
Expression
.Quote(resultSelector) }
588
Expression
.Call(
591
new
Expression
[] { source.Expression,
Expression
.Quote(keySelector),
Expression
.Quote(resultSelector) }
604
Expression
.Call(
607
new
Expression
[] { source.Expression,
Expression
.Quote(keySelector),
Expression
.Quote(resultSelector),
Expression
.Constant(comparer, typeof(IEqualityComparer<TKey>)) }
622
Expression
.Call(
625
new
Expression
[] { source.Expression,
Expression
.Quote(keySelector),
Expression
.Quote(elementSelector),
Expression
.Quote(resultSelector),
Expression
.Constant(comparer, typeof(IEqualityComparer<TKey>)) }
633
Expression
.Call(
636
new
Expression
[] { source.Expression }
644
Expression
.Call(
647
new
Expression
[] { source.Expression,
Expression
.Constant(comparer, typeof(IEqualityComparer<TSource>)) }
657
Expression
.Call(
660
new
Expression
[] { source1.Expression, GetSourceExpression(source2) }
672
Expression
.Call(
675
new
Expression
[] { source1.Expression, GetSourceExpression(source2),
Expression
.Quote(resultSelector) }
685
Expression
.Call(
688
new
Expression
[] { source1.Expression, GetSourceExpression(source2) }
698
Expression
.Call(
701
new
Expression
[] {
704
Expression
.Constant(comparer, typeof(IEqualityComparer<TSource>))
715
Expression
.Call(
718
new
Expression
[] { source1.Expression, GetSourceExpression(source2) }
728
Expression
.Call(
731
new
Expression
[] {
734
Expression
.Constant(comparer, typeof(IEqualityComparer<TSource>))
745
Expression
.Call(
748
new
Expression
[] { source1.Expression, GetSourceExpression(source2) }
758
Expression
.Call(
761
new
Expression
[] {
764
Expression
.Constant(comparer, typeof(IEqualityComparer<TSource>))
773
Expression
.Call(
776
new
Expression
[] { source.Expression }
786
Expression
.Call(
789
new
Expression
[] { source.Expression,
Expression
.Quote(predicate) }
797
Expression
.Call(
800
new
Expression
[] { source.Expression }
810
Expression
.Call(
813
new
Expression
[] { source.Expression,
Expression
.Quote(predicate) }
821
Expression
.Call(
824
new
Expression
[] { source.Expression }
834
Expression
.Call(
837
new
Expression
[] { source.Expression,
Expression
.Quote(predicate) }
845
Expression
.Call(
848
new
Expression
[] { source.Expression }
858
Expression
.Call(
861
new
Expression
[] { source.Expression,
Expression
.Quote(predicate) }
869
Expression
.Call(
872
new
Expression
[] { source.Expression }
882
Expression
.Call(
885
new
Expression
[] { source.Expression,
Expression
.Quote(predicate) }
893
Expression
.Call(
896
new
Expression
[] { source.Expression }
906
Expression
.Call(
909
new
Expression
[] { source.Expression,
Expression
.Quote(predicate) }
919
Expression
.Call(
922
new
Expression
[] { source.Expression,
Expression
.Constant(index) }
930
Expression
.Call(
933
new
Expression
[] { source.Expression,
Expression
.Constant(index) }
941
Expression
.Call(
944
new
Expression
[] { source.Expression }
952
Expression
.Call(
955
new
Expression
[] { source.Expression,
Expression
.Constant(defaultValue, typeof(TSource)) }
963
Expression
.Call(
966
new
Expression
[] { source.Expression,
Expression
.Constant(item, typeof(TSource)) }
974
Expression
.Call(
977
new
Expression
[] { source.Expression,
Expression
.Constant(item, typeof(TSource)),
Expression
.Constant(comparer, typeof(IEqualityComparer<TSource>)) }
985
Expression
.Call(
988
new
Expression
[] { source.Expression }
998
Expression
.Call(
1001
new
Expression
[] { source1.Expression, GetSourceExpression(source2) }
1011
Expression
.Call(
1014
new
Expression
[] {
1017
Expression
.Constant(comparer, typeof(IEqualityComparer<TSource>))
1026
Expression
.Call(
1029
new
Expression
[] { source.Expression }
1039
Expression
.Call(
1042
new
Expression
[] { source.Expression,
Expression
.Quote(predicate) }
1052
Expression
.Call(
1055
new
Expression
[] { source.Expression,
Expression
.Quote(predicate) }
1063
Expression
.Call(
1066
new
Expression
[] { source.Expression }
1076
Expression
.Call(
1079
new
Expression
[] { source.Expression,
Expression
.Quote(predicate) }
1087
Expression
.Call(
1090
new
Expression
[] { source.Expression }
1100
Expression
.Call(
1103
new
Expression
[] { source.Expression,
Expression
.Quote(predicate) }
1111
Expression
.Call(
1114
new
Expression
[] { source.Expression }
1124
Expression
.Call(
1127
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
1135
Expression
.Call(
1138
new
Expression
[] { source.Expression }
1148
Expression
.Call(
1151
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
1159
Expression
.Call(
1162
new
Expression
[] { source.Expression }
1170
Expression
.Call(
1173
new
Expression
[] { source.Expression }
1181
Expression
.Call(
1184
new
Expression
[] { source.Expression }
1192
Expression
.Call(
1195
new
Expression
[] { source.Expression }
1203
Expression
.Call(
1206
new
Expression
[] { source.Expression }
1214
Expression
.Call(
1217
new
Expression
[] { source.Expression }
1225
Expression
.Call(
1228
new
Expression
[] { source.Expression }
1236
Expression
.Call(
1239
new
Expression
[] { source.Expression }
1247
Expression
.Call(
1250
new
Expression
[] { source.Expression }
1258
Expression
.Call(
1261
new
Expression
[] { source.Expression }
1271
Expression
.Call(
1274
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
1284
Expression
.Call(
1287
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
1297
Expression
.Call(
1300
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
1310
Expression
.Call(
1313
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
1323
Expression
.Call(
1326
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
1336
Expression
.Call(
1339
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
1349
Expression
.Call(
1352
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
1362
Expression
.Call(
1365
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
1375
Expression
.Call(
1378
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
1388
Expression
.Call(
1391
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
1399
Expression
.Call(
1402
new
Expression
[] { source.Expression }
1410
Expression
.Call(
1413
new
Expression
[] { source.Expression }
1421
Expression
.Call(
1424
new
Expression
[] { source.Expression }
1432
Expression
.Call(
1435
new
Expression
[] { source.Expression }
1444
Expression
.Call(
1447
new
Expression
[] { source.Expression }
1456
Expression
.Call(
1459
new
Expression
[] { source.Expression }
1467
Expression
.Call(
1470
new
Expression
[] { source.Expression }
1478
Expression
.Call(
1481
new
Expression
[] { source.Expression }
1489
Expression
.Call(
1492
new
Expression
[] { source.Expression }
1500
Expression
.Call(
1503
new
Expression
[] { source.Expression }
1513
Expression
.Call(
1516
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
1526
Expression
.Call(
1529
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
1540
Expression
.Call(
1543
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
1554
Expression
.Call(
1557
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
1567
Expression
.Call(
1570
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
1580
Expression
.Call(
1583
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
1593
Expression
.Call(
1596
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
1606
Expression
.Call(
1609
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
1619
Expression
.Call(
1622
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
1632
Expression
.Call(
1635
new
Expression
[] { source.Expression,
Expression
.Quote(selector) }
1645
Expression
.Call(
1648
new
Expression
[] { source.Expression,
Expression
.Quote(func) }
1658
Expression
.Call(
1661
new
Expression
[] { source.Expression,
Expression
.Constant(seed),
Expression
.Quote(func) }
1673
Expression
.Call(
1676
new
Expression
[] { source.Expression,
Expression
.Constant(seed),
Expression
.Quote(func),
Expression
.Quote(selector) }
System\Linq\SequenceQuery.cs (44)
18
internal abstract
Expression
Expression { get; }
29
internal static IQueryable Create(Type elementType,
Expression
expression) {
41
Expression
expression;
53
this.expression =
Expression
.Constant(this);
57
public EnumerableQuery(
Expression
expression) {
61
internal override
Expression
Expression {
69
Expression
IQueryable.Expression {
77
IQueryable IQueryProvider.CreateQuery(
Expression
expression){
86
IQueryable<S> IQueryProvider.CreateQuery<S>(
Expression
expression){
101
object IQueryProvider.Execute(
Expression
expression){
109
S IQueryProvider.Execute<S>(
Expression
expression){
128
Expression
body = rewriter.Visit(this.expression);
129
Expression<Func<IEnumerable<T>>> f =
Expression
.Lambda<Func<IEnumerable<T>>>(body, (IEnumerable<ParameterExpression>)null);
150
internal static EnumerableExecutor Create(
Expression
expression) {
162
Expression
expression;
166
public EnumerableExecutor(
Expression
expression){
177
Expression
body = rewriter.Visit(this.expression);
178
Expression<Func<T>> f =
Expression
.Lambda<Func<T>>(body, (IEnumerable<ParameterExpression>)null);
191
internal override
Expression
VisitMethodCall(MethodCallExpression m) {
192
Expression
obj = this.Visit(m.Object);
193
ReadOnlyCollection<
Expression
> args = this.VisitExpressionList(m.Arguments);
197
Expression
[] argArray = args.ToArray();
203
return
Expression
.Call(obj, m.Method, args);
209
return
Expression
.Call(obj, seqMethod, args);
216
return
Expression
.Call(obj, method, args);
222
private ReadOnlyCollection<
Expression
> FixupQuotedArgs(MethodInfo mi, ReadOnlyCollection<
Expression
> argList) {
225
List<
Expression
> newArgs = null;
227
Expression
arg = argList[i];
231
newArgs = new List<
Expression
>(argList.Count);
246
private
Expression
FixupQuotedExpression(Type type,
Expression
expression) {
247
Expression
expr = expression;
260
List<
Expression
> exprs = new List<
Expression
>(na.Expressions.Count);
264
expression =
Expression
.NewArrayInit(elementType, exprs);
270
internal override
Expression
VisitLambda(LambdaExpression lambda) {
295
internal override
Expression
VisitConstant(ConstantExpression c) {
301
return
Expression
.Constant(sq.Enumerable, t);
308
internal override
Expression
VisitParameter(ParameterExpression p) {
313
static MethodInfo FindEnumerableMethod(string name, ReadOnlyCollection<
Expression
> args, params Type[] typeArgs) {
325
internal static MethodInfo FindMethod(Type type, string name, ReadOnlyCollection<
Expression
> args, Type[] typeArgs, BindingFlags flags) {
337
private static bool ArgsMatch(MethodInfo m, ReadOnlyCollection<
Expression
> args, Type[] typeArgs) {
361
Expression
arg = args[i];
System\Runtime\CompilerServices\ExecutionScope.cs (2)
31
public
Expression
IsolateExpression(
Expression
expression, object[] locals)
System.Data (14)
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\Model\ModelItemImpl.cs (14)
465
DynamicMetaObject IDynamicMetaObjectProvider.GetMetaObject(System.Linq.Expressions.
Expression
parameter)
529
public ModelItemMetaObject(System.Linq.Expressions.
Expression
parameter, ModelItemImpl target)
536
System.Linq.Expressions.
Expression
s = System.Linq.Expressions.
Expression
.Convert(this.Expression, typeof(ModelItemImpl));
537
System.Linq.Expressions.
Expression
value = System.Linq.Expressions.
Expression
.Call(s, getPropertyValueMethodInfo, System.Linq.Expressions.
Expression
.Constant(binder.Name));
543
System.Linq.Expressions.
Expression
s = System.Linq.Expressions.
Expression
.Convert(this.Expression, typeof(ModelItemImpl));
544
System.Linq.Expressions.
Expression
objectValue = System.Linq.Expressions.
Expression
.Convert(value.Expression, typeof(object));
545
System.Linq.Expressions.
Expression
valueExp = System.Linq.Expressions.
Expression
.Call(s, setPropertyValueMethodInfo, System.Linq.Expressions.
Expression
.Constant(binder.Name), objectValue);
System.Data.Entity (852)
System\Data\Common\Internal\Materialization\CompensatingCollection.cs (3)
33
private readonly
Expression
_expression;
42
_expression =
Expression
.Constant(source);
81
Expression
IQueryable.Expression
System\Data\Common\Internal\Materialization\CoordinatorFactory.cs (8)
203
public CoordinatorFactory(int depth, int stateSlot,
Expression
hasData,
Expression
setKeys,
Expression
checkKeys, CoordinatorFactory[] nestedCoordinators,
Expression
element,
Expression
elementWithErrorHandling,
Expression
initializeCollection, RecordStateFactory[] recordStateFactories)
246
private static Func<Shaper, bool> CompilePredicate(
Expression
predicate)
263
private static string DescribeExpression(
Expression
expression)
System\Data\Common\Internal\Materialization\CoordinatorScratchpad.cs (57)
38
private readonly Dictionary<
Expression
,
Expression
> _expressionWithErrorHandlingMap;
53
_expressionWithErrorHandlingMap = new Dictionary<
Expression
,
Expression
>();
74
internal
Expression
SetKeys { get; set; }
81
internal
Expression
CheckKeys { get; set; }
87
internal
Expression
HasData { get; set; }
93
internal
Expression
Element { get; set; }
98
internal
Expression
InitializeCollection { get; set; }
125
internal void AddExpressionWithErrorHandling(
Expression
expression,
Expression
expressionWithErrorHandling)
180
Expression
element = new SecurityBoundaryExpressionVisitor().Visit(replacementVisitor.Visit(this.Element));
185
Expression
elementWithErrorHandling = new SecurityBoundaryExpressionVisitor().Visit(replacementVisitor.Visit(this.Element));
228
private readonly Dictionary<
Expression
,
Expression
> _replacementDictionary;
231
internal ReplacementExpressionVisitor(Dictionary<
Expression
,
Expression
> replacementDictionary,
238
internal override
Expression
Visit(
Expression
expression)
245
Expression
result;
248
Expression
replacement;
271
Expression
body = Visit(lambda.Body);
274
result =
Expression
.Constant(Translator.Compile(body.Type, body));
311
private ParameterExpression _values =
Expression
.Parameter(typeof(object[]), "values");
312
private ParameterExpression _reader =
Expression
.Parameter(typeof(DbDataReader), "reader");
313
private List<
Expression
> _initializationArguments = new List<
Expression
>();
323
internal override
Expression
Visit(
Expression
exp)
343
var newArguments = new List<
Expression
>();
346
var
argument = arguments[i];
351
var
visitedArgument = this.Visit(argument);
357
var
convert = this.CreateInitializationArgumentReplacement(argument);
368
nex =
Expression
.New(nex.Constructor, newArguments);
372
var userMaterializationFunc =
Expression
.Lambda<Func<DbDataReader, object[], object>>(nex, _reader, _values).Compile();
375
return
Expression
.Convert(
376
Expression
.Call(
377
Expression
.Constant(userMaterializationFunc),
380
Expression
.NewArrayInit(typeof(object), _initializationArguments)),
390
internal override
Expression
VisitConditional(ConditionalExpression c)
418
internal override
Expression
VisitMemberAccess(MemberExpression m)
439
internal override
Expression
VisitMemberInit(MemberInitExpression init)
443
var
newMemberInit = base.VisitMemberInit(init);
448
var userMaterializationFunc =
Expression
.Lambda<Func<DbDataReader, object[], object>>(newMemberInit, _reader, _values).Compile();
451
return
Expression
.Convert(
452
Expression
.Call(
453
Expression
.Constant(userMaterializationFunc),
456
Expression
.NewArrayInit(typeof(object), _initializationArguments)),
487
internal override
Expression
VisitMethodCall(MethodCallExpression m)
525
private
Expression
CreateInitializationArgumentReplacement(
Expression
original)
530
private
Expression
CreateInitializationArgumentReplacement(
Expression
original, Type expressionType)
532
_initializationArguments.Add(
Expression
.Convert(original, typeof(object)));
534
return
Expression
.Convert(
535
Expression
.MakeBinary(ExpressionType.ArrayIndex, _values,
Expression
.Constant(_initializationArguments.Count - 1)),
System\Data\Common\Internal\Materialization\RecordStateFactory.cs (1)
97
public RecordStateFactory(int stateSlotNumber, int columnCount, RecordStateFactory[] nestedRecordStateFactories, DataRecordInfo dataRecordInfo,
Expression
gatherData, string[] propertyNames, TypeUsage[] typeUsages)
System\Data\Common\Internal\Materialization\RecordStateScratchpad.cs (2)
45
private
Expression
_gatherData;
46
internal
Expression
GatherData
System\Data\Common\Internal\Materialization\Translator.cs (308)
51
private readonly
Expression
ReturnedExpression;
54
internal TranslatorResult(
Expression
returnedExpression, Type requestedType)
64
internal
Expression
Expression
68
Expression
result = Translator.Emit_EnsureType(ReturnedExpression, RequestedType);
76
internal
Expression
UnconvertedExpression
88
internal
Expression
UnwrappedExpression
108
internal readonly
Expression
ExpressionToGetCoordinator;
110
internal CollectionTranslatorResult(
Expression
returnedExpression, ColumnMap columnMap, Type requestedType,
Expression
expressionToGetCoordinator)
254
internal static Func<Shaper, TResult> Compile<TResult>(
Expression
body)
256
var lambda =
Expression
.Lambda<Func<Shaper, TResult>>(body, Shaper_Parameter);
265
internal static object Compile(Type resultType,
Expression
body)
514
private LambdaExpression CreateInlineDelegate(
Expression
body)
524
private Expression<Func<Shaper, T>> TypedCreateInlineDelegate<T>(
Expression
body)
526
Expression<Func<Shaper, T>> result =
Expression
.Lambda<Func<Shaper, T>>(body, Shaper_Parameter);
587
private static readonly MethodInfo Translator_Compile = typeof(Translator).GetMethod("Compile", BindingFlags.NonPublic | BindingFlags.Static, null, new Type[] { typeof(
Expression
) }, null);
612
private static readonly
Expression
DBNull_Value =
Expression
.Constant(DBNull.Value, typeof(object));
614
internal static readonly ParameterExpression Shaper_Parameter =
Expression
.Parameter(typeof(Shaper), "shaper");
615
private static readonly ParameterExpression EntityParameter =
Expression
.Parameter(typeof(object), "entity");
617
internal static readonly
Expression
Shaper_Reader =
Expression
.Field(Shaper_Parameter, typeof(Shaper).GetField("Reader"));
618
private static readonly
Expression
Shaper_Workspace =
Expression
.Field(Shaper_Parameter, typeof(Shaper).GetField("Workspace"));
619
private static readonly
Expression
Shaper_State =
Expression
.Field(Shaper_Parameter, typeof(Shaper).GetField("State"));
620
private static readonly
Expression
Shaper_Context =
Expression
.Field(Shaper_Parameter, typeof(Shaper).GetField("Context"));
621
private static readonly
Expression
Shaper_Context_Options =
Expression
.Property(Shaper_Context, typeof(ObjectContext).GetProperty("ContextOptions"));
622
private static readonly
Expression
Shaper_ProxyCreationEnabled =
Expression
.Property(Shaper_Context_Options, typeof(ObjectContextOptions).GetProperty("ProxyCreationEnabled"));
629
private static
Expression
Emit_AndAlso(IEnumerable<
Expression
> operands)
631
Expression
result = null;
632
foreach (
Expression
operand in operands)
640
result =
Expression
.AndAlso(result, operand);
649
private static
Expression
Emit_BitwiseOr(IEnumerable<
Expression
> operands)
651
Expression
result = null;
652
foreach (
Expression
operand in operands)
660
result =
Expression
.Or(result, operand);
675
internal static
Expression
Emit_NullConstant(Type type)
677
Expression
nullConstant;
684
nullConstant =
Expression
.Constant(null, type);
689
nullConstant = Emit_EnsureType(
Expression
.Constant(null, typeof(object)), type);
699
internal static
Expression
Emit_WrappedNullConstant(Type type)
701
return
Expression
.Property(null, EntityWrapperFactory_NullWrapper);
710
internal static
Expression
Emit_EnsureType(
Expression
input, Type type)
712
Expression
result = input;
718
result =
Expression
.Convert(input, type);
725
result =
Expression
.Call(checkedConvertMethod, input);
743
internal static
Expression
Emit_EnsureTypeAndWrap(
Expression
input,
Expression
keyReader,
Expression
entitySetReader, Type requestedType, Type identityType, Type actualType, MergeOption mergeOption, bool isProxy)
745
Expression
result = Emit_EnsureType(input, requestedType); // Needed to ensure appropriate exception is thrown
757
private static
Expression
CreateEntityWrapper(
Expression
input,
Expression
keyReader,
Expression
entitySetReader, Type actualType, Type identityType, MergeOption mergeOption, bool isProxy)
759
Expression
result;
770
result =
Expression
.New(ci, input, keyReader, entitySetReader, Shaper_Context,
Expression
.Constant(mergeOption, typeof(MergeOption)),
Expression
.Constant(identityType, typeof(Type)));
778
Expression
propertyAccessorStrategy = !isIEntityWithRelationships || isProxy ?
779
Expression
.Call(EntityWrapperFactory_GetPocoPropertyAccessorStrategyFunc) :
780
Expression
.Call(EntityWrapperFactory_GetNullPropertyAccessorStrategyFunc);
782
Expression
keyStrategy = isIEntityWithKey ?
783
Expression
.Call(EntityWrapperFactory_GetEntityWithKeyStrategyStrategyFunc) :
784
Expression
.Call(EntityWrapperFactory_GetPocoEntityKeyStrategyFunc);
786
Expression
changeTrackingStrategy = isIEntityWithChangeTracker ?
787
Expression
.Call(EntityWrapperFactory_GetEntityWithChangeTrackerStrategyFunc) :
788
Expression
.Call(EntityWrapperFactory_GetSnapshotChangeTrackingStrategyFunc);
797
result =
Expression
.New(ci, input, keyReader, entitySetReader, Shaper_Context,
Expression
.Constant(mergeOption, typeof(MergeOption)),
Expression
.Constant(identityType, typeof(Type)),
800
result =
Expression
.Convert(result, typeof(IEntityWrapper));
808
internal static
Expression
Emit_UnwrapAndEnsureType(
Expression
input, Type type)
810
return Translator.Emit_EnsureType(
Expression
.Property(input, IEntityWrapper_Entity), type);
848
private static
Expression
Emit_Equal(
Expression
left,
Expression
right)
850
Expression
result;
854
result =
Expression
.Call(Translator_BinaryEquals, left, right);
858
result =
Expression
.Equal(left, right);
897
private static
Expression
Emit_EntityKey_ctor(Translator translator, EntityIdentity entityIdentity, bool isForColumnValue, out
Expression
entitySetReader)
899
Expression
result;
900
Expression
setEntitySetStateSlotValue = null;
903
List<
Expression
> keyReaders = new List<
Expression
>(entityIdentity.Keys.Length);
906
Expression
keyReader = entityIdentity.Keys[i].Accept(translator, new TranslatorArg(typeof(object))).Expression;
919
entitySetReader =
Expression
.Constant(null, typeof(EntitySet));
920
return
Expression
.Constant(null, typeof(EntityKey));
923
entitySetReader =
Expression
.Constant(simpleEntityIdentity.EntitySet, typeof(EntitySet));
932
Expression
discriminator = discriminatedEntityIdentity.EntitySetColumnMap.Accept(translator, new TranslatorArg(typeof(int?))).Expression;
939
entitySetReader =
Expression
.Constant(null, typeof(EntitySet));
942
entitySetReader =
Expression
.Condition(
943
Expression
.Equal(discriminator,
Expression
.Constant(i, typeof(int?))),
944
Expression
.Constant(entitySets[i], typeof(EntitySet)),
961
result =
Expression
.New(EntityKey_ctor_SingleKey,
968
result =
Expression
.New(EntityKey_ctor_CompositeKey,
970
Expression
.NewArrayInit(typeof(object), keyReaders));
980
Expression
noEntityKeyExpression;
983
noEntityKeyExpression =
Expression
.Constant(EntityKey.NoEntitySetKey, typeof(EntityKey));
987
noEntityKeyExpression =
Expression
.Constant(null, typeof(EntityKey));
989
result =
Expression
.Condition(
990
Expression
.Equal(setEntitySetStateSlotValue,
Expression
.Constant(null, typeof(EntitySet))),
1002
private static
Expression
Emit_EntityKey_HasValue(SimpleColumnMap[] keyColumns)
1007
Expression
result = Emit_Reader_IsDBNull(keyColumns[0]);
1008
result =
Expression
.Not(result);
1015
private static
Expression
Emit_Reader_GetValue(int ordinal, Type type)
1018
Expression
result = Emit_EnsureType(
Expression
.Call(Shaper_Reader, DbDataReader_GetValue,
Expression
.Constant(ordinal)), type);
1025
private static
Expression
Emit_Reader_IsDBNull(int ordinal)
1028
Expression
result =
Expression
.Call(Shaper_Reader, DbDataReader_IsDBNull,
Expression
.Constant(ordinal));
1036
private static
Expression
Emit_Reader_IsDBNull(ColumnMap columnMap)
1039
Expression
result = Emit_Reader_IsDBNull(((ScalarColumnMap)columnMap).ColumnPos);
1046
private static
Expression
Emit_Shaper_GetPropertyValueWithErrorHandling(Type propertyType, int ordinal, string propertyName, string typeName, TypeUsage columnType)
1049
Expression
result;
1053
result =
Expression
.Call(Shaper_Parameter, Shaper_GetSpatialPropertyValueWithErrorHandling.MakeGenericMethod(propertyType),
1054
Expression
.Constant(ordinal),
Expression
.Constant(propertyName),
Expression
.Constant(typeName),
Expression
.Constant(primitiveColumnType, typeof(PrimitiveTypeKind)));
1058
result =
Expression
.Call(Shaper_Parameter, Shaper_GetPropertyValueWithErrorHandling.MakeGenericMethod(propertyType),
Expression
.Constant(ordinal),
Expression
.Constant(propertyName),
Expression
.Constant(typeName));
1066
private static
Expression
Emit_Shaper_GetColumnValueWithErrorHandling(Type resultType, int ordinal, TypeUsage columnType)
1069
Expression
result;
1074
result =
Expression
.Call(Shaper_Parameter, Shaper_GetSpatialColumnValueWithErrorHandling.MakeGenericMethod(resultType),
Expression
.Constant(ordinal),
Expression
.Constant(primitiveColumnType, typeof(PrimitiveTypeKind)));
1078
result =
Expression
.Call(Shaper_Parameter, Shaper_GetColumnValueWithErrorHandling.MakeGenericMethod(resultType),
Expression
.Constant(ordinal));
1086
private static
Expression
Emit_Shaper_GetGeographyColumnValue(int ordinal)
1089
Expression
result =
Expression
.Call(Shaper_Parameter, Shaper_GetGeographyColumnValue,
Expression
.Constant(ordinal));
1096
private static
Expression
Emit_Shaper_GetGeometryColumnValue(int ordinal)
1099
Expression
result =
Expression
.Call(Shaper_Parameter, Shaper_GetGeometryColumnValue,
Expression
.Constant(ordinal));
1106
private static
Expression
Emit_Shaper_GetState(int stateSlotNumber, Type type)
1109
Expression
result = Emit_EnsureType(
Expression
.ArrayIndex(Shaper_State,
Expression
.Constant(stateSlotNumber)), type);
1116
private static
Expression
Emit_Shaper_SetState(int stateSlotNumber,
Expression
value)
1119
Expression
result =
Expression
.Call(Shaper_Parameter, Shaper_SetState.MakeGenericMethod(value.Type),
Expression
.Constant(stateSlotNumber), value);
1126
private static
Expression
Emit_Shaper_SetStatePassthrough(int stateSlotNumber,
Expression
value)
1129
Expression
result =
Expression
.Call(Shaper_Parameter, Shaper_SetStatePassthrough.MakeGenericMethod(value.Type),
Expression
.Constant(stateSlotNumber), value);
1151
Expression
result = null;
1152
Expression
nullSentinelCheck = null;
1175
result =
Expression
.MemberInit(
Expression
.New(constructor), propertyBindings);
1182
result =
Expression
.Condition(nullSentinelCheck, Emit_NullConstant(result.Type), result);
1193
Expression
result;
1205
Expression
entitySetReader = null;
1206
Expression
entityKeyReader = Emit_EntityKey_ctor(this, entityIdentity, false, out entitySetReader);
1210
Expression
nullCheckExpression =
Expression
.Not(Emit_EntityKey_HasValue(entityIdentity.Keys));
1216
Expression
constructEntity = null;
1236
Expression
constructNonProxyEntity = Emit_ConstructEntity(oSpaceType, propertyBindings, entityKeyReader, entitySetReader, arg, null);
1243
Expression
constructProxyEntity = Emit_ConstructEntity(oSpaceType, propertyBindings, entityKeyReader, entitySetReader, arg, proxyTypeInfo);
1245
constructEntity =
Expression
.Condition(Shaper_ProxyCreationEnabled,
1257
constructEntity =
Expression
.Call(Shaper_Parameter, Shaper_HandleIEntityWithKey.MakeGenericMethod(clrType),
1271
constructEntity =
Expression
.Call(Shaper_Parameter, Shaper_HandleEntityAppendOnly.MakeGenericMethod(clrType),
1279
constructEntity =
Expression
.Call(Shaper_Parameter, Shaper_HandleEntity.MakeGenericMethod(clrType),
1289
constructEntity =
Expression
.Call(Shaper_Parameter, Shaper_HandleEntityNoTracking.MakeGenericMethod(clrType),
1297
result =
Expression
.Condition(
1307
private
Expression
Emit_ConstructEntity(EntityType oSpaceType, IEnumerable<MemberBinding> propertyBindings,
Expression
entityKeyReader,
Expression
entitySetReader, TranslatorArg arg, EntityProxyTypeInfo proxyTypeInfo)
1313
Expression
constructEntity;
1317
constructEntity =
Expression
.MemberInit(
Expression
.New(proxyTypeInfo.ProxyType), propertyBindings);
1323
constructEntity =
Expression
.MemberInit(
Expression
.New(constructor), propertyBindings);
1334
constructEntity =
Expression
.Call(
Expression
.Constant(proxyTypeInfo), EntityProxyTypeInfo_SetEntityWrapper, constructEntity);
1338
constructEntity =
Expression
.Call(proxyTypeInfo.InitializeEntityCollections, constructEntity);
1375
Expression
valueReader = columnMap.Properties[i].Accept(this, new TranslatorArg(propertyType)).Expression;
1383
Expression
valueReaderWithErrorHandling = Emit_Shaper_GetPropertyValueWithErrorHandling(propertyType, scalarColumnMap.ColumnPos, propertyName, propertyAccessor.DeclaringType.Name, scalarColumnMap.Type);
1388
MemberBinding binding =
Expression
.Bind(GetProperty(propertyAccessor, entityDeclaringType), valueReader);
1424
Expression
result;
1429
Expression
discriminatorReader = AcceptWithMappedType(this, columnMap.TypeDiscriminator, columnMap).Expression;
1434
BuildExpressionToGetRecordState(columnMap, null, null,
Expression
.Constant(true)),
1453
Expression
discriminatorConstant =
Expression
.Constant(typeChoice.Key, discriminatorReader.Type);
1454
Expression
discriminatorMatches;
1461
discriminatorMatches =
Expression
.Call(
Expression
.Constant(TrailingSpaceStringComparer.Instance), IEqualityComparerOfString_Equals, discriminatorConstant, discriminatorReader);
1468
result =
Expression
.Condition(discriminatorMatches,
1483
Expression
result = (
Expression
)multipleDiscriminatorPolymorphicColumnMapHelper.Invoke(this, new object[] { columnMap, arg });
1491
private
Expression
MultipleDiscriminatorPolymorphicColumnMapHelper<TElement>(MultipleDiscriminatorPolymorphicColumnMap columnMap, TranslatorArg arg)
1494
Expression
[] discriminatorReaders = new
Expression
[columnMap.TypeDiscriminators.Length];
1499
Expression
discriminatorValues =
Expression
.NewArrayInit(typeof(object), discriminatorReaders);
1502
List<
Expression
> elementDelegates = new List<
Expression
>();
1507
Expression
typeReader = Emit_EnsureType(AcceptWithMappedType(this, typeChoice.Value, columnMap).UnwrappedExpression, typeof(TElement));
1509
Expression
typeDelegatePair =
Expression
.New(
1511
Expression
.Constant(typeChoice.Key),
1519
Expression
result =
Expression
.Call(Shaper_Parameter, shaperDiscriminateOfT,
1521
Expression
.Constant(columnMap.Discriminate),
1522
Expression
.NewArrayInit(typeDelegatePairType, elementDelegates)
1532
Expression
result = null;
1533
Expression
nullSentinelCheck = null;
1547
Expression
nullConstant;
1577
result =
Expression
.Condition(nullSentinelCheck, nullConstant, result);
1583
private
Expression
BuildExpressionToGetRecordState(StructuredColumnMap columnMap,
Expression
entityKeyReader,
Expression
entitySetReader,
Expression
nullCheckExpression)
1609
Expression
[] propertyReaders = new
Expression
[readerCount];
1615
Expression
propertyReader = columnMap.Properties[ordinal].Accept(this, new TranslatorArg(typeof(Object))).Expression;
1618
propertyReaders[ordinal] =
Expression
.Call(Shaper_Parameter, Shaper_SetColumnValue,
1619
Expression
.Constant(stateSlotNumber),
1620
Expression
.Constant(ordinal),
1621
Expression
.Coalesce(propertyReader, DBNull_Value)
1630
propertyReaders[readerCount - 1] =
Expression
.Call(Shaper_Parameter, Shaper_SetEntityRecordInfo,
1631
Expression
.Constant(stateSlotNumber),
1643
Expression
result =
Expression
.Call(Emit_Shaper_GetState(stateSlotNumber, typeof(RecordState)), RecordState_GatherData, Shaper_Parameter);
1649
Expression
nullResult =
Expression
.Call(Emit_Shaper_GetState(stateSlotNumber, typeof(RecordState)), RecordState_SetNullRecord, Shaper_Parameter);
1651
result =
Expression
.Condition(nullCheckExpression, nullResult, result);
1660
private
Expression
HandleLinqRecord(RecordColumnMap columnMap, InitializerMetadata initializerMetadata)
1681
Expression
result = initializerMetadata.Emit(this, propertyReaders);
1688
private
Expression
HandleRegularRecord(RecordColumnMap columnMap, TranslatorArg arg, RowType spanRowType)
1694
Expression
[] columnReaders = new
Expression
[columnMap.Properties.Length];
1697
Expression
columnReader = AcceptWithMappedType(this, columnMap.Properties[i], columnMap).UnwrappedExpression;
1700
columnReaders[i] =
Expression
.Coalesce(Emit_EnsureType(columnReader, typeof(object)), DBNull_Value);
1703
Expression
columnReaderArray =
Expression
.NewArrayInit(typeof(object), columnReaders);
1714
Expression
typeUsage =
Expression
.Constant(type, typeof(TypeUsage));
1717
Expression
result = Emit_EnsureType(
Expression
.New(MaterializedDataRecord_ctor, Shaper_Workspace, typeUsage, columnReaderArray), arg.RequestedType);
1724
private
Expression
HandleSpandexRecord(RecordColumnMap columnMap, TranslatorArg arg, RowType spanRowType)
1729
Expression
result = columnMap.Properties[0].Accept(this, arg).Expression;
1737
Expression
spannedResultReader = propertyTranslatorResult.Expression;
1743
Expression
expressionToGetCoordinator = collectionTranslatorResult.ExpressionToGetCoordinator;
1749
result =
Expression
.Call(Shaper_Parameter, handleFullSpanCollectionMethod, result, expressionToGetCoordinator,
Expression
.Constant(targetMember));
1757
result =
Expression
.Call(Shaper_Parameter, handleRelationshipSpanMethod, result, spannedResultReader,
Expression
.Constant(targetMember));
1763
result =
Expression
.Call(Shaper_Parameter, handleFullSpanElementMethod, result, spannedResultReader,
Expression
.Constant(targetMember));
1834
Expression
elementReader = elementColumnMap.Accept(this, new TranslatorArg(elementType)).UnconvertedExpression;
1839
Expression
[] keyReaders;
1843
keyReaders = new
Expression
[columnMap.Keys.Length];
1846
Expression
keyReader = AcceptWithMappedType(this, columnMap.Keys[i], columnMap).Expression;
1852
keyReaders = new
Expression
[] { };
1857
Expression
discriminatorReader = null;
1864
Expression
expressionToGetCoordinator = BuildExpressionToGetCoordinator(elementType, elementReader, keyReaders, discriminatorReader, discriminatorValue, coordinatorScratchpad);
1867
Expression
result;
1875
result =
Expression
.Call(expressionToGetCoordinator, getElementsExpression);
1898
Expression
.New(GetConstructor(typeToInstantiate)),
1913
result = Emit_EnsureType(
Expression
.New(constructorInfo, result), compensatingCollectionType);
1977
private
Expression
BuildExpressionToGetCoordinator(Type elementType,
Expression
element,
Expression
[] keyReaders,
Expression
discriminator, object discriminatorValue, CoordinatorScratchpad coordinatorScratchpad)
1988
List<
Expression
> setKeyTerms = new List<
Expression
>(keyReaders.Length);
1989
List<
Expression
> checkKeyTerms = new List<
Expression
>(keyReaders.Length);
1991
foreach (
Expression
keyReader in keyReaders)
2019
Expression
.Constant(discriminatorValue, discriminator.Type),
2026
Expression
result = Emit_Shaper_GetState(stateSlotNumber, typeof(Coordinator<>).MakeGenericType(elementType));
2043
Expression
entitySetReader; // Ignored here; used when constructing Entities
2046
Expression
result =
Expression
.Condition(
2049
Expression
.Constant(null, typeof(EntityKey))
2066
Expression
result;
2087
result =
Expression
.Call(Shaper_Reader, readerMethod,
Expression
.Constant(ordinal));
2097
result =
Expression
.Convert(result, nonNullableType);
2108
result =
Expression
.Condition(
2111
Expression
.Convert(
Expression
.Convert(result, TypeSystem.GetNonNullableType(DetermineClrType(columnType.EdmType))), typeof(object)));
2124
Expression
resultWithErrorHandling = Emit_Shaper_GetColumnValueWithErrorHandling(arg.RequestedType, ordinal, columnType);
2129
private static
Expression
Emit_Conditional_NotDBNull(
Expression
result, int ordinal, Type columnType)
2131
result =
Expression
.Condition(Emit_Reader_IsDBNull(ordinal),
2132
Expression
.Constant(TypeSystem.GetDefaultValue(columnType), columnType),
System\Data\Objects\ELinq\BindingContext.cs (4)
10
using LinqExpression = System.Linq.Expressions.
Expression
;
78
internal bool TryGetBoundExpression(
Expression
linqExpression, out CqtExpression cqtExpression)
97
internal Binding(
Expression
linqExpression, CqtExpression cqtExpression)
105
internal readonly
Expression
LinqExpression;
System\Data\Objects\ELinq\CompiledELinqQueryState.cs (5)
202
internal override
Expression
Expression
236
internal static
Expression
Replace(LambdaExpression query, ObjectContext objectContext, object[] parameterValues)
248
internal override
Expression
VisitParameter(ParameterExpression p)
251
Expression
result;
254
result =
Expression
.Constant(value, p.Type);
System\Data\Objects\ELinq\ELinqQueryState.cs (10)
34
private readonly
Expression
_expression;
50
internal ELinqQueryState(Type elementType, ObjectContext context,
Expression
expression)
72
internal ELinqQueryState(Type elementType, ObjectQuery query,
Expression
expression)
245
Expression
includeCall =
Expression
.Call(
Expression
.Constant(sourceQuery), includeMethod, new
Expression
[] {
Expression
.Constant(includePath, typeof(string)) });
269
internal override bool TryGetExpression(out System.Linq.Expressions.
Expression
expression)
277
internal virtual
Expression
Expression { get { return _expression; } }
System\Data\Objects\ELinq\EntityExpressionVisitor.cs (75)
25
internal virtual
Expression
Visit(
Expression
exp)
115
ReadOnlyCollection<
Expression
> arguments = this.VisitExpressionList(initializer.Arguments);
118
return
Expression
.ElementInit(initializer.AddMethod, arguments);
123
internal virtual
Expression
VisitUnary(UnaryExpression u)
125
Expression
operand = this.Visit(u.Operand);
128
return
Expression
.MakeUnary(u.NodeType, operand, u.Type, u.Method);
133
internal virtual
Expression
VisitBinary(BinaryExpression b)
135
Expression
left = this.Visit(b.Left);
136
Expression
right = this.Visit(b.Right);
137
Expression
conversion = this.Visit(b.Conversion);
141
return
Expression
.Coalesce(left, right, conversion as LambdaExpression);
143
return
Expression
.MakeBinary(b.NodeType, left, right, b.IsLiftedToNull, b.Method);
148
internal virtual
Expression
VisitTypeIs(TypeBinaryExpression b)
150
Expression
expr = this.Visit(b.Expression);
153
return
Expression
.TypeIs(expr, b.TypeOperand);
158
internal virtual
Expression
VisitConstant(ConstantExpression c)
163
internal virtual
Expression
VisitConditional(ConditionalExpression c)
165
Expression
test = this.Visit(c.Test);
166
Expression
ifTrue = this.Visit(c.IfTrue);
167
Expression
ifFalse = this.Visit(c.IfFalse);
170
return
Expression
.Condition(test, ifTrue, ifFalse);
175
internal virtual
Expression
VisitParameter(ParameterExpression p)
180
internal virtual
Expression
VisitMemberAccess(MemberExpression m)
182
Expression
exp = this.Visit(m.Expression);
185
return
Expression
.MakeMemberAccess(exp, m.Member);
190
internal virtual
Expression
VisitMethodCall(MethodCallExpression m)
192
Expression
obj = this.Visit(m.Object);
193
IEnumerable<
Expression
> args = this.VisitExpressionList(m.Arguments);
196
return
Expression
.Call(obj, m.Method, args);
201
internal virtual ReadOnlyCollection<
Expression
> VisitExpressionList(ReadOnlyCollection<
Expression
> original)
203
List<
Expression
> list = null;
206
Expression
p = this.Visit(original[i]);
213
list = new List<
Expression
>(n);
228
Expression
e = this.Visit(assignment.Expression);
231
return
Expression
.Bind(assignment.Member, e);
241
return
Expression
.MemberBind(binding.Member, bindings);
251
return
Expression
.ListBind(binding.Member, initializers);
306
internal virtual
Expression
VisitLambda(LambdaExpression lambda)
308
Expression
body = this.Visit(lambda.Body);
311
return
Expression
.Lambda(lambda.Type, body, lambda.Parameters);
318
IEnumerable<
Expression
> args = this.VisitExpressionList(nex.Arguments);
322
return
Expression
.New(nex.Constructor, args, nex.Members);
324
return
Expression
.New(nex.Constructor, args);
329
internal virtual
Expression
VisitMemberInit(MemberInitExpression init)
335
return
Expression
.MemberInit(n, bindings);
340
internal virtual
Expression
VisitListInit(ListInitExpression init)
346
return
Expression
.ListInit(n, initializers);
351
internal virtual
Expression
VisitNewArray(NewArrayExpression na)
353
IEnumerable<
Expression
> exprs = this.VisitExpressionList(na.Expressions);
358
return
Expression
.NewArrayInit(na.Type.GetElementType(), exprs);
362
return
Expression
.NewArrayBounds(na.Type.GetElementType(), exprs);
368
internal virtual
Expression
VisitInvocation(InvocationExpression iv)
370
IEnumerable<
Expression
> args = this.VisitExpressionList(iv.Arguments);
371
Expression
expr = this.Visit(iv.Expression);
374
return
Expression
.Invoke(expr, args);
379
internal virtual
Expression
VisitExtension(
Expression
ext)
384
internal static
Expression
Visit(
Expression
exp, Func<
Expression
, Func<
Expression
,
Expression
>,
Expression
> visit)
392
private readonly Func<
Expression
, Func<
Expression
,
Expression
>,
Expression
> _visit;
393
internal BasicExpressionVisitor(Func<
Expression
, Func<
Expression
,
Expression
>,
Expression
> visit)
397
internal override
Expression
Visit(
Expression
exp)
System\Data\Objects\ELinq\ExpressionConverter.cs (17)
35
private readonly
Expression
_expression;
118
internal ExpressionConverter(Funcletizer funcletizer,
Expression
expression)
324
private bool IsQueryRoot(
Expression
Expression)
880
Expression
argument = callExpression.Arguments[argumentOrdinal];
884
private
Expression
GetLambdaExpression(
Expression
argument)
899
private DbExpression TranslateSet(
Expression
linq)
905
private DbExpression TranslateExpression(
Expression
linq)
1360
Expression
patternExpression = call.Arguments[0];
1361
Expression
inputExpression = call.Object;
1453
private DbFunctionExpression TranslateIntoCanonicalFunction(string functionName,
Expression
Expression, params
Expression
[] linqArguments)
1470
private DbFunctionExpression CreateCanonicalFunction(string functionName,
Expression
Expression, params DbExpression[] translatedArguments)
1489
private EdmFunction FindCanonicalFunction(string functionName, IList<TypeUsage> argumentTypes, bool isGroupAggregateFunction,
Expression
Expression)
1503
private EdmFunction FindFunction(string namespaceName, string functionName, IList<TypeUsage> argumentTypes, bool isGroupAggregateFunction,
Expression
Expression)
1527
private static void ThrowUnresolvableFunction(
Expression
Expression)
1548
private static void ThrowUnresolvableFunctionOverload(
Expression
Expression, bool isAmbiguous)
System\Data\Objects\ELinq\Funcletizer.cs (49)
41
private readonly HashSet<
Expression
> _linqExpressionStack = new HashSet<
Expression
>();
59
_rootContextExpression =
Expression
.Constant(_rootContext);
111
internal
Expression
Funcletize(
Expression
expression, out Func<bool> recompileRequired)
117
Func<
Expression
, bool> isClientConstant;
118
Func<
Expression
, bool> isClientVariable;
148
Expression
result = visitor.Visit(expression);
158
private
Expression
ReplaceRootContextParameter(
Expression
expression)
176
private static Func<
Expression
, bool> Nominate(
Expression
expression, Func<
Expression
, bool> localCriterion)
179
HashSet<
Expression
> candidates = new HashSet<
Expression
>();
181
Func<
Expression
, Func<
Expression
,
Expression
>,
Expression
> visit = (exp, baseVisit) =>
220
private bool IsImmutable(
Expression
expression)
252
private bool IsClosureExpression(
Expression
expression)
272
private bool IsCompiledQueryParameterVariable(
Expression
expression)
324
private readonly Func<
Expression
, bool> _isClientConstant;
325
private readonly Func<
Expression
, bool> _isClientVariable;
330
Func<
Expression
, bool> isClientConstant,
331
Func<
Expression
, bool> isClientVariable)
354
internal override
Expression
Visit(
Expression
exp)
397
private static NotSupportedException InvalidCompiledQueryParameterException(
Expression
expression)
441
private Func<object> CompileExpression(
Expression
expression)
443
Func<object> func =
Expression
453
private
Expression
InlineValue(
Expression
expression, bool recompileOnChange)
487
Expression
result = null;
498
result = InlineExpression(
Expression
.Quote(lambda));
505
:
Expression
.Constant(value, expression.Type);
550
private
Expression
InlineObjectQuery(ObjectQuery inlineQuery, Type expressionType)
554
Expression
queryExpression;
559
queryExpression =
Expression
.Constant(inlineQuery, expressionType);
582
private
Expression
InlineExpression(
Expression
exp)
602
private readonly
Expression
_funcletizedExpression;
608
Expression
funcletizedExpression,
646
_cachedDelegate =
Expression
.Lambda(delegateType, _funcletizedExpression, _compiledQueryParameters).Compile();
664
Expression
wrappedExpression =
Expression
.Invoke(
Expression
.Constant(method), this._funcletizedExpression);
686
private bool TryEvaluatePath(
Expression
expression, out ConstantExpression constantExpression)
717
constantExpression =
Expression
.Constant(memberVal, expression.Type);
System\Data\Objects\ELinq\InitializerFacet.cs (30)
138
internal abstract
Expression
Emit(Translator translator, List<TranslatorResult> propertyTranslatorResults);
151
protected static List<
Expression
> GetPropertyReaders(List<TranslatorResult> propertyTranslatorResults)
153
List<
Expression
> propertyReaders = propertyTranslatorResults.Select(s => s.UnwrappedExpression).ToList();
214
internal override
Expression
Emit(Translator translator, List<TranslatorResult> propertyTranslatorResults)
229
Expression
newGrouping =
Expression
.Convert(
Expression
.New(constructor, GetPropertyReaders(propertyTranslatorResults)), this.ClrType);
297
internal override
Expression
Emit(Translator translator, List<TranslatorResult> propertyTranslatorResults)
303
Expression
nullProjection =
Expression
.Constant(null, this.ClrType);
306
Expression
newProjection =
Expression
.New(_newExpression.Constructor, GetPropertyReaders(propertyTranslatorResults));
309
return
Expression
.Call(UserExpressionMarker.MakeGenericMethod(newProjection.Type), newProjection);
336
internal override
Expression
Emit(Translator translator, List<TranslatorResult> propertyReaders)
389
internal override
Expression
Emit(Translator translator, List<TranslatorResult> propertyReaders)
400
Expression
value = propertyReaders[i].UnwrappedExpression;
401
MemberBinding newBinding =
Expression
.Bind(originalBinding.Member, value);
402
MemberBinding constantBinding =
Expression
.Bind(originalBinding.Member,
Expression
.Constant(
408
Expression
newProjection =
Expression
.MemberInit(_initExpression.NewExpression, memberBindings);
411
return
Expression
.Call(UserExpressionMarker.MakeGenericMethod(newProjection.Type), newProjection);
469
internal override
Expression
Emit(Translator translator, List<TranslatorResult> propertyTranslatorResults)
477
Expression
shaper = Translator.Shaper_Parameter;
478
Expression
owner = propertyTranslatorResults[0].Expression;
482
Expression
coordinator = collectionResult.ExpressionToGetCoordinator;
485
Expression
result =
Expression
.Call(createEntityCollectionMethod,
486
shaper, owner, coordinator,
Expression
.Constant(_navigationProperty.RelationshipType.FullName),
Expression
.Constant(_navigationProperty.ToEndMember.Name));
System\Data\Objects\ELinq\LinqExpressionNormalizer.cs (62)
48
private readonly Dictionary<
Expression
, Pattern> _patterns = new Dictionary<
Expression
, Pattern>();
56
internal override
Expression
VisitBinary(BinaryExpression b)
65
Expression
normalizedLeft = UnwrapObjectConvert(b.Left);
66
Expression
normalizedRight = UnwrapObjectConvert(b.Right);
97
private static
Expression
UnwrapObjectConvert(
Expression
input)
109
return
Expression
.Constant(constant.Value, constant.Value.GetType());
124
private bool IsConstantZero(
Expression
expression)
136
internal override
Expression
VisitMethodCall(MethodCallExpression m)
154
return
Expression
.Equal(m.Arguments[0], m.Arguments[1], LiftToNull, m.Method);
157
return
Expression
.NotEqual(m.Arguments[0], m.Arguments[1], LiftToNull, m.Method);
160
return
Expression
.GreaterThan(m.Arguments[0], m.Arguments[1], LiftToNull, m.Method);
163
return
Expression
.GreaterThanOrEqual(m.Arguments[0], m.Arguments[1], LiftToNull, m.Method);
166
return
Expression
.LessThan(m.Arguments[0], m.Arguments[1], LiftToNull, m.Method);
169
return
Expression
.LessThanOrEqual(m.Arguments[0], m.Arguments[1], LiftToNull, m.Method);
172
return
Expression
.Multiply(m.Arguments[0], m.Arguments[1], m.Method);
175
return
Expression
.Subtract(m.Arguments[0], m.Arguments[1], m.Method);
178
return
Expression
.Add(m.Arguments[0], m.Arguments[1], m.Method);
181
return
Expression
.Divide(m.Arguments[0], m.Arguments[1], m.Method);
184
return
Expression
.Modulo(m.Arguments[0], m.Arguments[1], m.Method);
187
return
Expression
.And(m.Arguments[0], m.Arguments[1], m.Method);
190
return
Expression
.Or(m.Arguments[0], m.Arguments[1], m.Method);
193
return
Expression
.ExclusiveOr(m.Arguments[0], m.Arguments[1], m.Method);
209
return
Expression
.Negate(m.Arguments[0], m.Method);
212
return
Expression
.UnaryPlus(m.Arguments[0], m.Method);
216
return
Expression
.Convert(m.Arguments[0], m.Type, m.Method);
220
return
Expression
.Not(m.Arguments[0], m.Method);
234
return
Expression
.Equal(m.Arguments[0], m.Arguments[1], false, m.Method);
293
return
Expression
.Call(enumerableContainsMethod, m.Object, m.Arguments[0]);
315
Expression
normalizedArgument;
319
List<
Expression
> normalizedArguments = new List<
Expression
>(callExpression.Arguments);
324
result =
Expression
.Call(callExpression.Object, callExpression.Method, normalizedArguments);
386
private static bool TryMatchCoalescePattern(
Expression
expression, out
Expression
normalized)
398
normalized =
Expression
.Quote(normalized);
414
normalized =
Expression
.Lambda(lambda.Type,
Expression
.Convert(coalesce.Left, typeof(bool)), lambda.Parameters);
437
private static BinaryExpression CreateRelationalOperator(ExpressionType op,
Expression
left,
Expression
right)
451
private static bool TryCreateRelationalOperator(ExpressionType op,
Expression
left,
Expression
right, out BinaryExpression result)
458
result =
Expression
.Equal(left, right, LiftToNull, relationalOperatorPlaceholderMethod);
462
result =
Expression
.NotEqual(left, right, LiftToNull, relationalOperatorPlaceholderMethod);
466
result =
Expression
.LessThan(left, right, LiftToNull, relationalOperatorPlaceholderMethod);
470
result =
Expression
.LessThanOrEqual(left, right, LiftToNull, relationalOperatorPlaceholderMethod);
474
result =
Expression
.GreaterThan(left, right, LiftToNull, relationalOperatorPlaceholderMethod);
478
result =
Expression
.GreaterThanOrEqual(left, right, LiftToNull, relationalOperatorPlaceholderMethod);
497
private
Expression
CreateCompareExpression(
Expression
left,
Expression
right)
499
Expression
result =
Expression
.Condition(
501
Expression
.Constant(0),
502
Expression
.Condition(
504
Expression
.Constant(1),
505
Expression
.Constant(-1)));
537
internal ComparePattern(
Expression
left,
Expression
right)
546
internal readonly
Expression
Left;
551
internal readonly
Expression
Right;
System\Data\Objects\ELinq\MethodCallTranslator.cs (19)
23
using LinqExpression = System.Linq.Expressions.
Expression
;
342
internal static
LinqExpression
RemoveConvertToObjectQuery(
LinqExpression
queryExpression)
487
LinqExpression
inputQuery = RemoveConvertToObjectQuery(call.Object);
509
LinqExpression
inputQuery = RemoveConvertToObjectQuery(call.Object);
700
private
Expression
UnwrapNoOpConverts(
Expression
expression)
708
Expression
operand = UnwrapNoOpConverts(convertExpression.Operand);
859
LinqExpression
[] linqArguments;
864
List<
LinqExpression
> arguments = new List<
LinqExpression
>(call.Arguments.Count + 1);
1335
internal static bool IsEmptyArray(
LinqExpression
expression)
1543
LinqExpression
linqCount = call.Arguments[1];
1659
protected CqtExpression TranslateLeft(ExpressionConverter parent,
LinqExpression
expr)
1663
protected virtual CqtExpression TranslateRight(ExpressionConverter parent,
LinqExpression
expr)
1719
protected override CqtExpression TranslateRight(ExpressionConverter parent,
LinqExpression
expr)
2217
parent.TranslateExpression(
Expression
.Constant(defaultValue, elementType));
2241
internal static DbExpression TranslateContains(ExpressionConverter parent,
Expression
sourceExpression,
Expression
valueExpression)
System\Data\Objects\ELinq\ObjectQueryProvider.cs (8)
63
IQueryable<S> IQueryProvider.CreateQuery<S>(
Expression
expression)
85
S IQueryProvider.Execute<S>(
Expression
expression)
100
IQueryable IQueryProvider.CreateQuery(
Expression
expression)
124
object IQueryProvider.Execute(
Expression
expression)
139
private ObjectQuery<S> CreateQuery<S>(
Expression
expression)
161
private ObjectQuery CreateQuery(
Expression
expression, Type ofType)
189
internal static TResult ExecuteSingle<TResult>(IEnumerable<TResult> query,
Expression
queryRoot)
194
private static Func<IEnumerable<TResult>, TResult> GetElementFunction<TResult>(
Expression
queryRoot)
System\Data\Objects\ELinq\ReflectionUtil.cs (1)
388
internal static bool TryIdentifySequenceMethod(
Expression
expression, bool unwrapLambda, out SequenceMethod sequenceMethod)
System\Data\Objects\ELinq\SpatialMethodCallTranslator.cs (1)
236
Expression
[] arguments;
System\Data\Objects\ELinq\Translator.cs (20)
37
internal abstract DbExpression Translate(ExpressionConverter parent,
Expression
linq);
47
where T_Linq :
Expression
51
internal override DbExpression Translate(ExpressionConverter parent,
Expression
linq)
85
var expressions = new List<
Expression
>();
88
expressions.Add(
Expression
.Constant(o, elementType));
95
return parent.TranslateExpression(
Expression
.NewArrayInit(elementType, expressions));
381
private static DbExpression TranslateCount(ExpressionConverter parent, Type sequenceElementType,
Expression
sequence)
389
Expression
countCall =
Expression
.Call(countMethod, sequence);
887
internal override DbExpression Translate(ExpressionConverter parent,
Expression
linq)
898
internal override DbExpression Translate(ExpressionConverter parent,
Expression
linq)
1007
Expression
linqLeft = linq.Left;
1008
Expression
linqRight = linq.Right;
1030
private static DbExpression CreateIsNullExpression(ExpressionConverter parent,
Expression
input)
1040
private static bool ExpressionIsNullConstant(
Expression
expression)
1050
private static
Expression
UnwrapConvert(
Expression
input)
1067
Expression
notLinq =
Expression
.Not(
1068
Expression
.Equal(linq.Left, linq.Right));
System\Data\Objects\ELinq\TypeSystem.cs (3)
89
internal static
Expression
EnsureType(
Expression
expression, Type requiredType)
95
expression =
Expression
.Convert(expression, requiredType);
System\Data\Objects\EntityFunctions.cs (64)
40
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
54
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
68
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
82
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
96
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
110
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
124
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
138
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
152
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
166
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
180
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
194
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
208
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
222
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
236
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
250
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
264
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
278
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
292
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
306
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
320
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
334
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
348
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
362
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
376
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
390
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
404
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
418
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
432
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
446
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
460
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
474
return ((IQueryable)objectQuerySource).Provider.Execute<System.Double?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(collection)));
System\Data\Objects\Internal\EntityProxyFactory.cs (4)
311
ParameterExpression Object_Parameter =
Expression
.Parameter(typeof(object), "instance");
312
Func<object, object> nonProxyGetter =
Expression
.Lambda<Func<object, object>>(
313
Expression
.PropertyOrField(
314
Expression
.Convert(Object_Parameter, declaringType),
System\Data\Objects\Internal\EntityProxyTypeInfo.cs (17)
78
ParameterExpression Object_Parameter =
Expression
.Parameter(typeof(object), "proxy");
79
ParameterExpression Value_Parameter =
Expression
.Parameter(typeof(object), "value");
84
Expression<Func<object, object>> lambda =
Expression
.Lambda<Func<object, object>>(
85
Expression
.Field(
86
Expression
.Convert(Object_Parameter, entityWrapperField.DeclaringType), entityWrapperField),
103
Proxy_SetEntityWrapper =
Expression
.Lambda<Func<object, object, object>>(
104
Expression
.Assign(
105
Expression
.Field(
106
Expression
.Convert(Object_Parameter, entityWrapperField.DeclaringType),
112
ParameterExpression PropertyName_Parameter =
Expression
.Parameter(typeof(string), "propertyName");
116
_baseGetter =
Expression
.Lambda<Func<object, string, object>>(
117
Expression
.Call(
Expression
.Convert(Object_Parameter, proxyType), baseGetterMethod, PropertyName_Parameter),
121
ParameterExpression PropertyValue_Parameter =
Expression
.Parameter(typeof(object), "propertyName");
125
_baseSetter =
Expression
.Lambda<Action<object, string, object>>(
126
Expression
.Call(
Expression
.Convert(Object_Parameter, proxyType), baseSetterMethod, PropertyName_Parameter, PropertyValue_Parameter),
System\Data\Objects\Internal\EntitySqlQueryState.cs (1)
119
internal override bool TryGetExpression(out System.Linq.Expressions.
Expression
expression)
System\Data\Objects\Internal\ObjectQueryState.cs (1)
242
internal abstract bool TryGetExpression(out System.Linq.Expressions.
Expression
expression);
System\Data\Objects\Internal\PocoPropertyAccessorStrategy.cs (2)
303
return
Expression
.Lambda<Func<object>>(
Expression
.New(typeToInstantiate)).Compile();
System\Data\Objects\ObjectContext.cs (1)
845
var
body = selector.Body;
System\Data\Objects\ObjectQuery.cs (2)
105
System.Linq.Expressions.
Expression
IQueryable.Expression
113
internal abstract System.Linq.Expressions.
Expression
GetExpression();
System\Data\Objects\ObjectQuery_TResultType.cs (7)
120
internal override
Expression
GetExpression()
124
Expression
retExpr;
127
retExpr =
Expression
.Constant(this);
136
retExpr =
Expression
.Call(retExpr, mergeAsMethod,
Expression
.Constant(this.QueryState.UserSpecifiedMergeOption.Value));
144
retExpr =
Expression
.Call(retExpr, includeSpanMethod,
Expression
.Constant(this.QueryState.Span));
System\Data\Objects\SqlClient\SqlFunctions.cs (4)
40
return ((IQueryable)objectQuerySource).Provider.Execute<System.Int32?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(arg)));
54
return ((IQueryable)objectQuerySource).Provider.Execute<System.Int32?>(
Expression
.Call((MethodInfo)MethodInfo.GetCurrentMethod(),
Expression
.Constant(arg)));
System\Data\Query\InternalTrees\ColumnMapFactory.cs (5)
159
Expression
.Bind(prop,
Expression
.Parameter(prop.PropertyType, "placeholder")),
191
NewExpression newExpr = null == constructor ?
Expression
.New(type) :
Expression
.New(constructor);
192
MemberInitExpression init =
Expression
.MemberInit(newExpr, memberBindings);
System\Data\SqlClient\SqlSpatialDataReader.cs (7)
89
var readerParam =
Expression
.Parameter(typeof(BinaryReader));
90
var binarySerializable =
Expression
.Variable(spatialType);
93
var ex =
Expression
.Lambda<Func<BinaryReader, object>>(
94
Expression
.Block(
96
Expression
.Assign(binarySerializable,
Expression
.New(spatialType)),
97
Expression
.Call(binarySerializable, readMethod, readerParam),
System\Data\SqlClient\SqlTypesAssembly.cs (54)
23
internal static
Expression
Null<TNullType>()
25
return
Expression
.Constant(null, typeof(TNullType));
28
internal static
Expression
Null(Type nullType)
30
return
Expression
.Constant(null, nullType);
33
internal static Expression<Func<TArg, TResult>> Lambda<TArg, TResult>(string argumentName, Func<ParameterExpression,
Expression
> createLambdaBodyGivenParameter)
35
ParameterExpression argParam =
Expression
.Parameter(typeof(TArg), argumentName);
36
Expression
lambdaBody = createLambdaBodyGivenParameter(argParam);
37
return
Expression
.Lambda<Func<TArg, TResult>>(lambdaBody, argParam);
40
internal static
Expression
Call(this
Expression
exp, string methodName)
42
return
Expression
.Call(exp, methodName, Type.EmptyTypes);
45
internal static
Expression
ConvertTo(this
Expression
exp, Type convertToType)
47
return
Expression
.Convert(exp, convertToType);
50
internal static
Expression
ConvertTo<TConvertToType>(this
Expression
exp)
52
return
Expression
.Convert(exp, typeof(TConvertToType));
57
private readonly
Expression
condition;
58
private readonly
Expression
ifTrueThen;
60
internal ConditionalExpressionBuilder(
Expression
conditionExpression,
Expression
ifTrueExpression)
66
internal
Expression
Else(
Expression
resultIfFalse)
68
return
Expression
.Condition(this.condition, ifTrueThen, resultIfFalse);
72
internal static ConditionalExpressionBuilder IfTrueThen(this
Expression
conditionExp,
Expression
resultIfTrue)
77
internal static
Expression
Property<TPropertyType>(this
Expression
exp, string propertyName)
82
return
Expression
.Property(exp, prop);
520
var dataParam =
Expression
.Parameter(typeof(TArg));
521
var sridParam =
Expression
.Parameter(typeof(int));
526
Expression
sqlData = BuildConvertToSqlType(dataParam, staticCtorMethod.GetParameters()[0].ParameterType);
528
var ex =
Expression
.Lambda<Func<TArg, int, object>>(
Expression
.Call(null, staticCtorMethod, sqlData, sridParam), dataParam, sridParam);
533
private static
Expression
BuildConvertToSqlType(
Expression
toConvert, Type convertTo)
562
private static
Expression
BuildConvertToSqlBytes(
Expression
toConvert, Type sqlBytesType)
568
Expression
result =
Expression
.New(byteArrayCtor, toConvert);
572
private static
Expression
BuildConvertToSqlChars(
Expression
toConvert, Type sqlCharsType)
580
Expression
result =
Expression
.New(sqlCharsFromSqlStringCtor,
Expression
.New(sqlStringFromStringCtor, toConvert));
584
private static
Expression
BuildConvertToSqlString(
Expression
toConvert, Type sqlStringType)
590
Expression
result =
Expression
.Convert(
Expression
.New(sqlStringFromStringCtor, toConvert), typeof(object));
594
private static
Expression
BuildConvertToSqlXml(
Expression
toConvert, Type sqlXmlType)
600
Expression
result =
Expression
.New(readerCtor, toConvert);
System.Data.Linq (550)
ChangeDirector.cs (74)
84
Expression
cmd = this.GetInsertCommand(item);
107
Expression
cmd = this.GetInsertCommand(item);
137
Expression
cmd = this.GetUpdateCommand(item);
160
Expression
cmd = this.GetUpdateCommand(item);
185
Expression
cmd = this.GetDeleteCommand(item);
201
Expression
cmd = this.GetDeleteCommand(item);
230
private
Expression
GetInsertCommand(TrackedObject item) {
235
ParameterExpression p =
Expression
.Parameter(item.Type.Table.RowType.Type, "p");
237
Expression
autoSync = this.CreateAutoSync(membersToSync, p);
238
LambdaExpression resultSelector =
Expression
.Lambda(autoSync, p);
239
return
Expression
.Call(typeof(DataManipulation), "Insert", new Type[] { item.Type.InheritanceRoot.Type, resultSelector.Body.Type },
Expression
.Constant(item.Current), resultSelector);
242
return
Expression
.Call(typeof(DataManipulation), "Insert", new Type[] { item.Type.InheritanceRoot.Type },
Expression
.Constant(item.Current));
250
private
Expression
CreateAutoSync(List<MetaDataMember> membersToSync,
Expression
source) {
253
Expression
[] initializers = new
Expression
[membersToSync.Count];
255
initializers[i++] =
Expression
.Convert(this.GetMemberExpression(source, mm.Member), typeof(object));
257
return
Expression
.NewArrayInit(typeof(object), initializers);
314
private
Expression
GetUpdateCommand(TrackedObject tracked) {
319
ParameterExpression p =
Expression
.Parameter(rowTypeRoot.Type, "p");
320
Expression
pv = p;
322
pv =
Expression
.Convert(p, rowType.Type);
325
Expression
check = this.GetUpdateCheck(pv, tracked);
327
check =
Expression
.Lambda(check, p);
333
Expression
autoSync = this.CreateAutoSync(membersToSync, pv);
334
LambdaExpression resultSelector =
Expression
.Lambda(autoSync, p);
336
return
Expression
.Call(typeof(DataManipulation), "Update", new Type[] { rowTypeRoot.Type, resultSelector.Body.Type },
Expression
.Constant(tracked.Current), check, resultSelector);
339
return
Expression
.Call(typeof(DataManipulation), "Update", new Type[] { rowTypeRoot.Type, resultSelector.Body.Type },
Expression
.Constant(tracked.Current), resultSelector);
343
return
Expression
.Call(typeof(DataManipulation), "Update", new Type[] { rowTypeRoot.Type },
Expression
.Constant(tracked.Current), check);
346
return
Expression
.Call(typeof(DataManipulation), "Update", new Type[] { rowTypeRoot.Type },
Expression
.Constant(tracked.Current));
350
private
Expression
GetUpdateCheck(
Expression
serverItem, TrackedObject tracked) {
353
return
Expression
.Equal(
355
this.GetMemberExpression(
Expression
.Constant(tracked.Current), mt.VersionMember.Member)
359
Expression
expr = null;
366
Expression
eq =
367
Expression
.Equal(
369
Expression
.Constant(memberValue, mm.Type)
371
expr = (expr != null) ?
Expression
.And(expr, eq) : eq;
379
private
Expression
GetDeleteCommand(TrackedObject tracked) {
382
ParameterExpression p =
Expression
.Parameter(rowTypeRoot.Type, "p");
383
Expression
pv = p;
385
pv =
Expression
.Convert(p, rowType.Type);
388
Expression
check = this.GetUpdateCheck(pv, tracked);
390
check =
Expression
.Lambda(check, p);
391
return
Expression
.Call(typeof(DataManipulation), "Delete", new Type[] { rowTypeRoot.Type },
Expression
.Constant(original), check);
394
return
Expression
.Call(typeof(DataManipulation), "Delete", new Type[] { rowTypeRoot.Type },
Expression
.Constant(original));
398
private
Expression
GetDeleteVerificationCommand(TrackedObject tracked) {
401
ParameterExpression p =
Expression
.Parameter(table.ElementType, "p");
402
Expression
pred =
Expression
.Lambda(
Expression
.Equal(p,
Expression
.Constant(tracked.Current)), p);
403
Expression
where =
Expression
.Call(typeof(Queryable), "Where", new Type[] { table.ElementType }, table.Expression, pred);
404
Expression
selector =
Expression
.Lambda(
Expression
.Constant(0, typeof(int?)), p);
405
Expression
select =
Expression
.Call(typeof(Queryable), "Select", new Type[] { table.ElementType, typeof(int?) }, where, selector);
406
Expression
singleOrDefault =
Expression
.Call(typeof(Queryable), "SingleOrDefault", new Type[] { typeof(int?) }, select);
411
private
Expression
GetMemberExpression(
Expression
exp, MemberInfo mi) {
414
return
Expression
.Field(exp, fi);
416
return
Expression
.Property(exp, pi);
DataContext.cs (15)
807
private
Expression
GetMethodCall(object instance, MethodInfo methodInfo, params object[] parameters) {
811
List<
Expression
> args = new List<
Expression
>(parameters.Length);
817
args.Add(
Expression
.Constant(parameters[i], pType));
819
return
Expression
.Call(
Expression
.Constant(instance), methodInfo, args);
821
return
Expression
.Call(
Expression
.Constant(instance), methodInfo);
1131
Expression
IQueryable.Expression {
1132
get { return
Expression
.Constant(this); }
1146
IQueryable IQueryProvider.CreateQuery(
Expression
expression) {
1160
IQueryable<TResult> IQueryProvider.CreateQuery<TResult>(
Expression
expression) {
1170
object IQueryProvider.Execute(
Expression
expression) {
1175
TResult IQueryProvider.Execute<TResult>(
Expression
expression) {
1188
return ((IEnumerable<TEntity>)this.context.Provider.Execute(
Expression
.Constant(this)).ReturnValue).GetEnumerator();
DataQuery.cs (7)
17
Expression
queryExpression;
20
public DataQuery(DataContext context,
Expression
expression) {
25
Expression
IQueryable.Expression {
34
IQueryable IQueryProvider.CreateQuery(
Expression
expression) {
45
IQueryable<S> IQueryProvider.CreateQuery<S>(
Expression
expression) {
53
object IQueryProvider.Execute(
Expression
expression) {
57
S IQueryProvider.Execute<S>(
Expression
expression) {
DataServices.cs (51)
202
internal
Expression
GetObjectQuery(MetaType type, object[] keyValues) {
212
internal
Expression
GetObjectQuery(MetaType type,
Expression
[] keyValues) {
214
ParameterExpression serverItem =
Expression
.Parameter(table.ElementType, "p");
217
Expression
whereExpression = null;
220
Expression
memberExpression = (metaMember.Member is FieldInfo)
221
?
Expression
.Field(serverItem, (FieldInfo)metaMember.Member)
222
:
Expression
.Property(serverItem, (PropertyInfo)metaMember.Member);
223
Expression
memberEqualityExpression =
Expression
.Equal(memberExpression, keyValues[i]);
225
?
Expression
.And(whereExpression, memberEqualityExpression)
228
return
Expression
.Call(typeof(Queryable), "Where", new Type[] { table.ElementType }, table.Expression,
Expression
.Lambda(whereExpression, serverItem));
231
internal
Expression
GetDataMemberQuery(MetaDataMember member,
Expression
[] keyValues) {
239
Expression
thisSource =
Expression
.Constant(context.GetTable(rootType));
241
thisSource =
Expression
.Call(typeof(Enumerable), "Cast", new Type[] { association.ThisMember.DeclaringType.Type }, thisSource);
243
Expression
thisInstance =
Expression
.Call(typeof(Enumerable), "FirstOrDefault", new Type[] { association.ThisMember.DeclaringType.Type },
246
Expression
otherSource =
Expression
.Constant(context.GetTable(association.OtherType.InheritanceRoot.Type));
248
otherSource =
Expression
.Call(typeof(Enumerable), "Cast", new Type[] { association.OtherType.Type }, otherSource);
250
Expression
expr = System.Data.Linq.SqlClient.Translator.TranslateAssociation(
256
Expression
query = this.GetObjectQuery(member.DeclaringType, keyValues);
258
ParameterExpression p =
Expression
.Parameter(elementType, "p");
259
Expression
e = p;
261
e =
Expression
.Convert(e, member.DeclaringType.Type);
262
Expression
mem = (member.Member is PropertyInfo)
263
?
Expression
.Property(e, (PropertyInfo)member.Member)
264
:
Expression
.Field(e, (FieldInfo)member.Member);
265
LambdaExpression selector =
Expression
.Lambda(mem, p);
266
return
Expression
.Call(typeof(Queryable), "Select", new Type[] { elementType, selector.Body.Type }, query, selector);
270
private static
Expression
[] BuildKeyExpressions(object[] keyValues, ReadOnlyCollection<MetaDataMember> keyMembers) {
271
Expression
[] keyValueExpressions = new
Expression
[keyValues.Length];
274
Expression
keyValueExpression =
Expression
.Constant(keyValues[i], metaMember.Type);
414
ParameterExpression p =
Expression
.Parameter(typeof(object[]), "keys");
415
Expression
[] keyExprs = new
Expression
[keyValues.Length];
419
keyExprs[i] =
Expression
.Convert(
421
Expression
.ArrayIndex(p,
Expression
.Constant(i)),
426
Expression
q = this.services.GetDataMemberQuery(this.member, keyExprs);
427
LambdaExpression lambda =
Expression
.Lambda(q, p);
469
public object GetCachedObject(
Expression
query) {
533
private bool GetKeysFromPredicate(MetaType type, Dictionary<MetaDataMember, object> keys,
Expression
expr) {
538
bex =
Expression
.Equal(mex.Arguments[0], mex.Arguments[1]);
556
private static bool GetKeyFromPredicate(MetaType type, Dictionary<MetaDataMember, object> keys,
Expression
mex,
Expression
vex) {
DataShape.cs (7)
65
Expression
op = expression.Body;
69
LambdaExpression lambda =
Expression
.Lambda(op, expression.Parameters.ToArray());
166
Expression
body = lambda.Body;
191
internal override
Expression
VisitMemberAccess(MemberExpression m) {
196
internal override
Expression
VisitMethodCall(MethodCallExpression m) {
198
foreach (
Expression
arg in m.Arguments) {
270
internal override
Expression
VisitMethodCall(MethodCallExpression m) {
Provider\IDataServices.cs (1)
15
object GetCachedObject(
Expression
query);
Provider\IProvider.cs (4)
77
IExecuteResult Execute(
Expression
query);
84
ICompiledQuery Compile(
Expression
query);
109
string GetQueryText(
Expression
query);
116
DbCommand GetCommand(
Expression
query);
SqlClient\Common\SqlFactory.cs (29)
203
internal SqlExpression DATEADD(string partName, SqlExpression value, SqlExpression expr,
Expression
sourceExpression, bool asNullable) {
221
internal SqlExpression DATETIMEOFFSETADD(string partName, SqlExpression value, SqlExpression expr,
Expression
sourceExpression, bool asNullable) {
288
internal SqlExpression Value(Type clrType, ProviderType sqlType, object value, bool isClientSpecified,
Expression
sourceExpression) {
299
internal SqlExpression StaticType(MetaType typeOf,
Expression
sourceExpression) {
316
internal SqlTable Table(MetaTable table, MetaType rowType,
Expression
sourceExpression) {
324
internal SqlRowNumber RowNumber(List<SqlOrderExpression> orderBy,
Expression
sourceExpression) {
328
internal SqlUnary Unary(SqlNodeType nodeType, SqlExpression expression,
Expression
sourceExpression) {
332
internal SqlUnary Unary(SqlNodeType nodeType, SqlExpression expression, MethodInfo method,
Expression
sourceExpression) {
363
internal SqlUnary UnaryConvert(Type targetClrType, ProviderType targetSqlType, SqlExpression expression,
Expression
sourceExpression) {
369
internal SqlUnary UnaryValueOf(SqlExpression expression,
Expression
sourceExpression) {
418
internal SqlBetween Between(SqlExpression expr, SqlExpression start, SqlExpression end,
Expression
source) {
422
internal SqlIn In(SqlExpression expr, IEnumerable<SqlExpression> values,
Expression
source) {
426
internal SqlLike Like(SqlExpression expr, SqlExpression pattern, SqlExpression escape,
Expression
source) {
432
internal SqlSearchedCase SearchedCase(SqlWhen[] whens, SqlExpression @else,
Expression
sourceExpression) {
441
internal SqlExpression Case(Type clrType, SqlExpression discriminator, List<SqlExpression> matches, List<SqlExpression> values,
Expression
sourceExpression) {
465
internal SqlExpression Parameter(object value,
Expression
source) {
471
internal SqlExpression ValueFromObject(object value,
Expression
sourceExpression) {
475
internal SqlExpression ValueFromObject(object value, bool isClientSpecified,
Expression
sourceExpression) {
485
internal SqlExpression ValueFromObject(object value, Type clrType, bool isClientSpecified,
Expression
sourceExpression) {
493
public SqlExpression TypedLiteralNull(Type type,
Expression
sourceExpression) {
512
internal SqlExpression TypeCase(Type clrType, MetaType rowType, SqlExpression discriminator, IEnumerable<SqlTypeCaseWhen> whens,
Expression
sourceExpression) {
516
internal SqlNew New(MetaType type, ConstructorInfo cons, IEnumerable<SqlExpression> args, IEnumerable<MemberInfo> argMembers, IEnumerable<SqlMemberAssign> bindings,
Expression
sourceExpression) {
521
internal SqlMethodCall MethodCall(MethodInfo method, SqlExpression obj, SqlExpression[] args,
Expression
sourceExpression) {
525
internal SqlMethodCall MethodCall(Type returnType, MethodInfo method, SqlExpression obj, SqlExpression[] args,
Expression
sourceExpression) {
530
internal SqlExprSet ExprSet(SqlExpression[] exprs,
Expression
sourceExpression) {
564
internal SqlFunctionCall FunctionCall(Type clrType, string name, IEnumerable<SqlExpression> args,
Expression
source) {
569
internal SqlFunctionCall FunctionCall(Type clrType, ProviderType sqlType, string name, IEnumerable<SqlExpression> args,
Expression
source) {
573
internal SqlTableValuedFunctionCall TableValuedFunctionCall(MetaType rowType, Type clrType, string name, IEnumerable<SqlExpression> args,
Expression
source) {
593
internal SqlJoin MakeJoin(SqlJoinType joinType, SqlSource location, SqlAlias alias, SqlExpression condition,
Expression
source) {
SqlClient\Common\SqlNode.cs (51)
115
private
Expression
sourceExpression;
117
internal SqlNode(SqlNodeType nodeType,
Expression
sourceExpression) {
122
internal
Expression
SourceExpression {
153
internal SqlExpression(SqlNodeType nodeType, Type clrType,
Expression
sourceExpression)
201
internal SqlSimpleTypeExpression(SqlNodeType nodeType, Type clrType, ProviderType sqlType,
Expression
sourceExpression)
217
internal SqlDiscriminatorOf(SqlExpression obj, Type clrType, ProviderType sqlType,
Expression
sourceExpression)
235
internal SqlDiscriminatedType(ProviderType sqlType, SqlExpression discriminator, MetaType targetType,
Expression
sourceExpression)
259
internal SqlStatement(SqlNodeType nodeType,
Expression
sourceExpression)
265
internal SqlSource(SqlNodeType nt,
Expression
sourceExpression)
284
internal SqlSelect(SqlExpression selection, SqlSource from,
Expression
sourceExpression)
384
internal SqlTable(MetaTable table, MetaType rowType, ProviderType sqlRowType,
Expression
sourceExpression)
428
internal SqlUserQuery(SqlNodeType nt, SqlExpression projection, IEnumerable<SqlExpression> args,
Expression
source)
435
internal SqlUserQuery(string queryText, SqlExpression projection, IEnumerable<SqlExpression> args,
Expression
source)
476
internal SqlStoredProcedureCall(MetaFunction function, SqlExpression projection, IEnumerable<SqlExpression> args,
Expression
source)
492
internal SqlUserRow(MetaType rowType, ProviderType sqlType, SqlUserQuery query,
Expression
source)
519
internal SqlUserColumn(Type clrType, ProviderType sqlType, SqlUserQuery query, string name, bool isRequired,
Expression
source)
635
internal SqlJoin(SqlJoinType type, SqlSource left, SqlSource right, SqlExpression cond,
Expression
sourceExpression)
743
internal SqlNop(Type clrType, ProviderType sqlType,
Expression
sourceExpression)
751
internal SqlLift(Type type, SqlExpression liftedExpression,
Expression
sourceExpression)
875
internal SqlRowNumber(Type clrType, ProviderType sqlType, List<SqlOrderExpression> orderByList,
Expression
sourceExpression)
890
internal SqlUnary(SqlNodeType nt, Type clrType, ProviderType sqlType, SqlExpression expr,
Expression
sourceExpression)
894
internal SqlUnary(SqlNodeType nt, Type clrType, ProviderType sqlType, SqlExpression expr, MethodInfo method,
Expression
sourceExpression)
1007
internal SqlBetween(Type clrType, ProviderType sqlType, SqlExpression expr, SqlExpression start, SqlExpression end,
Expression
source)
1034
internal SqlIn(Type clrType, ProviderType sqlType, SqlExpression expression, IEnumerable<SqlExpression> values,
Expression
sourceExpression)
1059
internal SqlLike(Type clrType, ProviderType sqlType, SqlExpression expr, SqlExpression pattern, SqlExpression escape,
Expression
source)
1152
internal SqlSearchedCase(Type clrType, IEnumerable<SqlWhen> whens, SqlExpression @else,
Expression
sourceExpression)
1196
internal SqlSimpleCase(Type clrType, SqlExpression expr, IEnumerable<SqlWhen> whens,
Expression
sourceExpression)
1240
internal SqlClientCase(Type clrType, SqlExpression expr, IEnumerable<SqlClientWhen> whens,
Expression
sourceExpression)
1320
internal SqlTypeCase(Type clrType, ProviderType sqlType, MetaType rowType, SqlExpression discriminator, IEnumerable<SqlTypeCaseWhen> whens,
Expression
sourceExpression)
1387
internal SqlValue(Type clrType, ProviderType sqlType, object value, bool isClientSpecified,
Expression
sourceExpression)
1406
internal SqlParameter(Type clrType, ProviderType sqlType, string name,
Expression
sourceExpression)
1429
internal SqlVariable(Type clrType, ProviderType sqlType, string name,
Expression
sourceExpression)
1478
internal SqlColumn(Type clrType, ProviderType sqlType, string name, MetaDataMember member, SqlExpression expr,
Expression
sourceExpression)
1580
internal SqlRow(
Expression
sourceExpression)
1628
internal SqlGrouping(Type clrType, ProviderType sqlType, SqlExpression key, SqlExpression group,
Expression
sourceExpression)
1667
internal SqlNew(MetaType metaType, ProviderType sqlType, ConstructorInfo cons, IEnumerable<SqlExpression> args, IEnumerable<MemberInfo> argMembers, IEnumerable<SqlMemberAssign> members,
Expression
sourceExpression)
1732
internal SqlMethodCall(Type clrType, ProviderType sqlType, MethodInfo method, SqlExpression obj, IEnumerable<SqlExpression> args,
Expression
sourceExpression)
1765
internal SqlIncludeScope(SqlNode child,
Expression
sourceExpression)
1778
internal SqlClientArray(Type clrType, ProviderType sqlType, SqlExpression[ ] exprs,
Expression
sourceExpression)
1798
internal SqlLink(object id, MetaType rowType, Type clrType, ProviderType sqlType, SqlExpression expression, MetaDataMember member, IEnumerable<SqlExpression> keyExpressions, SqlExpression expansion,
Expression
sourceExpression)
1841
internal SqlExprSet(Type clrType, IEnumerable <SqlExpression> exprs,
Expression
sourceExpression)
1934
internal SqlJoinedCollection(Type clrType, ProviderType sqlType, SqlExpression expression, SqlExpression count,
Expression
sourceExpression)
1965
internal SqlUpdate(SqlSelect select, IEnumerable<SqlAssign> assignments,
Expression
sourceExpression)
1992
internal SqlInsert(SqlTable table, SqlExpression expr,
Expression
sourceExpression)
2038
internal SqlDelete(SqlSelect select,
Expression
sourceExpression)
2056
internal SqlBlock(
Expression
sourceExpression)
2070
internal SqlAssign(SqlExpression lValue, SqlExpression rValue,
Expression
sourceExpression)
2153
internal SqlFunctionCall(Type clrType, ProviderType sqlType, string name, IEnumerable <SqlExpression > args ,
Expression
source)
2157
internal SqlFunctionCall(SqlNodeType nodeType, Type clrType, ProviderType sqlType, string name , IEnumerable <SqlExpression> args ,
Expression
source)
2180
internal SqlTableValuedFunctionCall(MetaType rowType, Type clrType, ProviderType sqlType, string name, IEnumerable <SqlExpression > args ,
Expression
source)
2273
internal SqlClientParameter(Type clrType, ProviderType sqlType, LambdaExpression accessor,
Expression
sourceExpression):
SqlClient\Query\Funcletizer.cs (84)
13
internal static
Expression
Funcletize(
Expression
expression) {
18
Dictionary<
Expression
, bool> locals;
20
internal Localizer(Dictionary<
Expression
, bool> locals) {
24
internal
Expression
Localize(
Expression
expression) {
28
internal override
Expression
Visit(
Expression
exp) {
41
private static
Expression
MakeLocal(
Expression
e) {
48
Expression
local = MakeLocal(ue.Operand);
49
return (e.NodeType == ExpressionType.Convert) ?
Expression
.Convert(local, e.Type) :
Expression
.ConvertChecked(local, e.Type);
55
return
Expression
.Constant(null, ue.Type);
59
return
Expression
.Invoke(
Expression
.Constant(
Expression
.Lambda(e).Compile()));
70
static public bool IsIndependent(
Expression
expression) {
75
internal override
Expression
VisitLambda(LambdaExpression lambda) {
81
internal override
Expression
VisitParameter(ParameterExpression p) {
89
Dictionary<
Expression
, bool> locals;
91
internal Dictionary<
Expression
, bool> MapLocals(
Expression
expression) {
92
this.locals = new Dictionary<
Expression
, bool>();
98
internal override
Expression
Visit(
Expression
expression) {
126
internal override
Expression
VisitMemberAccess(MemberExpression m) {
131
internal override
Expression
VisitMethodCall(MethodCallExpression m) {
146
internal virtual
Expression
Visit(
Expression
exp) {
232
ReadOnlyCollection<
Expression
> arguments = this.VisitExpressionList(initializer.Arguments);
234
return
Expression
.ElementInit(initializer.AddMethod, arguments);
239
internal virtual
Expression
VisitUnary(UnaryExpression u) {
240
Expression
operand = this.Visit(u.Operand);
242
return
Expression
.MakeUnary(u.NodeType, operand, u.Type, u.Method);
247
internal virtual
Expression
VisitBinary(BinaryExpression b) {
248
Expression
left = this.Visit(b.Left);
249
Expression
right = this.Visit(b.Right);
251
return
Expression
.MakeBinary(b.NodeType, left, right, b.IsLiftedToNull, b.Method);
256
internal virtual
Expression
VisitTypeIs(TypeBinaryExpression b) {
257
Expression
expr = this.Visit(b.Expression);
259
return
Expression
.TypeIs(expr, b.TypeOperand);
264
internal virtual
Expression
VisitConstant(ConstantExpression c) {
268
internal virtual
Expression
VisitConditional(ConditionalExpression c) {
269
Expression
test = this.Visit(c.Test);
270
Expression
ifTrue = this.Visit(c.IfTrue);
271
Expression
ifFalse = this.Visit(c.IfFalse);
273
return
Expression
.Condition(test, ifTrue, ifFalse);
278
internal virtual
Expression
VisitParameter(ParameterExpression p) {
282
internal virtual
Expression
VisitMemberAccess(MemberExpression m) {
283
Expression
exp = this.Visit(m.Expression);
285
return
Expression
.MakeMemberAccess(exp, m.Member);
290
internal virtual
Expression
VisitMethodCall(MethodCallExpression m) {
291
Expression
obj = this.Visit(m.Object);
292
IEnumerable<
Expression
> args = this.VisitExpressionList(m.Arguments);
294
return
Expression
.Call(obj, m.Method, args);
299
internal virtual ReadOnlyCollection<
Expression
> VisitExpressionList(ReadOnlyCollection<
Expression
> original) {
300
List<
Expression
> list = null;
302
Expression
p = this.Visit(original[i]);
307
list = new List<
Expression
>(n);
315
return new ReadOnlyCollection<
Expression
>(list);
320
Expression
e = this.Visit(assignment.Expression);
322
return
Expression
.Bind(assignment.Member, e);
330
return
Expression
.MemberBind(binding.Member, bindings);
338
return
Expression
.ListBind(binding.Member, initializers);
384
internal virtual
Expression
VisitLambda(LambdaExpression lambda) {
385
Expression
body = this.Visit(lambda.Body);
387
return
Expression
.Lambda(lambda.Type, body, lambda.Parameters);
393
IEnumerable<
Expression
> args = this.VisitExpressionList(nex.Arguments);
396
return
Expression
.New(nex.Constructor, args, nex.Members);
399
return
Expression
.New(nex.Constructor, args);
405
internal virtual
Expression
VisitMemberInit(MemberInitExpression init) {
409
return
Expression
.MemberInit(n, bindings);
414
internal virtual
Expression
VisitListInit(ListInitExpression init) {
418
return
Expression
.ListInit(n, initializers);
423
internal virtual
Expression
VisitNewArray(NewArrayExpression na) {
424
IEnumerable<
Expression
> exprs = this.VisitExpressionList(na.Expressions);
427
return
Expression
.NewArrayInit(na.Type.GetElementType(), exprs);
430
return
Expression
.NewArrayBounds(na.Type.GetElementType(), exprs);
436
internal virtual
Expression
VisitInvocation(InvocationExpression iv) {
437
IEnumerable<
Expression
> args = this.VisitExpressionList(iv.Arguments);
438
Expression
expr = this.Visit(iv.Expression);
440
return
Expression
.Invoke(expr, args);
SqlClient\Query\MethodCallConverter.cs (1)
190
private SqlExpression CreateComparison(SqlExpression a, SqlExpression b,
Expression
source) {
SqlClient\Query\QueryConverter.cs (116)
46
Dictionary<ParameterExpression,
Expression
> exprMap;
49
Expression
dominatingExpression;
85
this.exprMap = new Dictionary<ParameterExpression,
Expression
>();
96
internal SqlNode ConvertOuter(
Expression
node) {
123
internal SqlNode Visit(
Expression
node) {
137
internal SqlNode ConvertInner(
Expression
node,
Expression
dominantExpression) {
148
private SqlNode VisitInner(
Expression
node) {
150
Expression
save = this.dominatingExpression;
240
private static
Expression
ChooseBestDominatingExpression(
Expression
last,
Expression
next) {
274
private SqlSelect VisitSequence(
Expression
exp) {
291
Expression
fex = Funcletizer.Funcletize(query.Expression);
343
return this.VisitInvocation(
Expression
.Invoke(cq.Expression, invoke.Arguments));
376
ParameterExpression pa =
Expression
.Parameter(typeof(object[]), "args");
378
Expression
.Lambda(
380
Expression
.Convert(
382
Expression
.ArrayIndex(pa,
Expression
.Constant(i)),
399
private SqlExpression VisitExpression(
Expression
exp) {
412
private SqlSelect VisitSelect(
Expression
sequence, LambdaExpression selector) {
459
private SqlSelect VisitSelectMany(
Expression
sequence, LambdaExpression colSelector, LambdaExpression resultSelector) {
482
private SqlSelect VisitJoin(
Expression
outerSequence,
Expression
innerSequence, LambdaExpression outerKeySelector, LambdaExpression innerKeySelector, LambdaExpression resultSelector) {
514
private SqlSelect VisitGroupJoin(
Expression
outerSequence,
Expression
innerSequence, LambdaExpression outerKeySelector, LambdaExpression innerKeySelector, LambdaExpression resultSelector) {
543
private SqlSelect VisitDefaultIfEmpty(
Expression
sequence) {
574
private SqlSelect VisitOfType(
Expression
sequence, Type ofType) {
594
private SqlNode VisitSequenceCast(
Expression
sequence, Type type) {
596
ParameterExpression p =
Expression
.Parameter(sourceType, "pc");
597
return this.Visit(
Expression
.Call(
604
Expression
.Lambda(
605
Expression
.Convert(p, type),
627
private SqlSelect VisitWhere(
Expression
sequence, LambdaExpression predicate) {
671
Expression
.Lambda(
673
Expression
.ArrayIndex(cpArray.Accessor.Body,
Expression
.Constant(vIndex.Value, vIndex.ClrType)),
693
private SqlNode VisitChangeType(
Expression
expression, Type type) {
714
Expression
.Lambda(
Expression
.Convert(cp.Accessor.Body, type), cp.Accessor.Parameters.ToArray()),
824
return this.VisitCast(
Expression
.Convert(qn.Arguments[0], qn.Type)) as SqlExpression;
827
return this.VisitCast(
Expression
.Convert(qn.Arguments[0], typeof(decimal))) as SqlExpression;
859
return this.VisitCast(
Expression
.Convert(qn.Arguments[0], typeof(decimal))) as SqlExpression;
921
private SqlSelect VisitDistinct(
Expression
sequence) {
928
private SqlSelect VisitTake(
Expression
sequence,
Expression
count) {
1041
private SqlSelect VisitSkip(
Expression
sequence,
Expression
skipCount) {
1146
Expression
expr;
1240
private SqlUserQuery VisitUserQuery(string query,
Expression
[] arguments, Type resultType) {
1403
private SqlNode VisitConcat(
Expression
source1,
Expression
source2) {
1414
private SqlNode VisitUnion(
Expression
source1,
Expression
source2) {
1425
private SqlNode VisitIntersect(
Expression
source1,
Expression
source2) {
1449
private SqlNode VisitExcept(
Expression
source1,
Expression
source2) {
1484
private SqlSelect VisitOrderBy(
Expression
sequence, LambdaExpression expression, SqlOrderType orderType) {
1507
private SqlSelect VisitThenBy(
Expression
sequence, LambdaExpression expression, SqlOrderType orderType) {
1525
private SqlNode VisitGroupBy(
Expression
sequence, LambdaExpression keyLambda, LambdaExpression elemLambda, LambdaExpression resultSelector) {
1626
private SqlNode VisitAggregate(
Expression
sequence, LambdaExpression lambda, SqlNodeType aggType, Type returnType) {
1649
lambda =
Expression
.Lambda(selectionLambda.Type, selectionLambda.Body, selectionLambda.Parameters);
1776
private SqlNode VisitContains(
Expression
sequence,
Expression
value) {
1793
ParameterExpression p =
Expression
.Parameter(value.Type, "p");
1794
LambdaExpression lambda =
Expression
.Lambda(
Expression
.Equal(p, value), p);
1814
private SqlNode VisitQuantifier(
Expression
sequence, LambdaExpression lambda, bool isAny) {
1865
return this.Visit(
Expression
.Constant(table));
1911
return this.Visit(
Expression
.Constant(table));
1947
private object GetValue(
Expression
expression, string operation) {
1955
private static
Expression
[] GetArray(
Expression
array) {
1965
return obs.Select(o =>
Expression
.Constant(o, elemType)).ToArray();
1968
return new
Expression
[] { };
1972
private
Expression
RemoveQuotes(
Expression
expression) {
1979
private bool IsLambda(
Expression
expression) {
1983
private LambdaExpression GetLambda(
Expression
expression) {
2371
private SqlNode VisitFirst(
Expression
sequence, LambdaExpression lambda, bool isFirst) {
2389
private SqlStatement VisitInsert(
Expression
item, LambdaExpression resultSelector) {
2396
Expression
source = this.services.Context.GetTable(metaTable.RowType.Type).Expression;
2477
ParameterExpression p =
Expression
.Parameter(id.Type, "p");
2478
Expression
[] init = new
Expression
[1] {
Expression
.Convert(p, typeof(object)) };
2479
NewArrayExpression arrExp =
Expression
.NewArrayInit(typeof(object), init);
2480
LambdaExpression rs =
Expression
.Lambda(arrExp, p);
2502
private bool IsDbGeneratedKeyProjectionOnly(
Expression
projection, MetaDataMember keyMember) {
2505
Expression
exp = array.Expressions[0];
2556
private SqlStatement VisitUpdate(
Expression
item, LambdaExpression check, LambdaExpression resultSelector) {
2561
Expression
source = this.services.Context.GetTable(metaTable.RowType.Type).Expression;
2568
Expression
seq = source;
2570
ParameterExpression p =
Expression
.Parameter(rowType, "p");
2571
LambdaExpression idPredicate =
Expression
.Lambda(
Expression
.Equal(p, item), p);
2576
findPredicate =
Expression
.Lambda(
Expression
.And(
Expression
.Invoke(findPredicate, p),
Expression
.Invoke(check, p)), p);
2578
seq =
Expression
.Call(typeof(Enumerable), "Where", new Type[] { rowType }, seq, findPredicate);
2616
seq =
Expression
.Call(typeof(Enumerable), "Where", new Type[] { rowType }, seq, idPredicate);
2617
seq =
Expression
.Call(typeof(Enumerable), "Select", new Type[] { rowType, resultSelector.Body.Type }, seq, resultSelector);
2635
private SqlStatement VisitDelete(
Expression
item, LambdaExpression check) {
2645
Expression
source = this.services.Context.GetTable(metaTable.RowType.Type).Expression;
2649
ParameterExpression p =
Expression
.Parameter(rowType, "p");
2650
LambdaExpression idPredicate =
Expression
.Lambda(
Expression
.Equal(p, item), p);
2655
findPredicate =
Expression
.Lambda(
Expression
.And(
Expression
.Invoke(findPredicate, p),
Expression
.Invoke(check, p)), p);
2657
Expression
seq =
Expression
.Call(typeof(Enumerable), "Where", new Type[] { rowType }, source, findPredicate);
SqlClient\Query\SqlBinder.cs (2)
938
Expression
.Lambda(
940
Expression
.MakeMemberAccess(cp.Accessor.Body, m.Member),
SqlClient\Query\SqlExpander.cs (1)
30
Expression
sourceExpression;
SqlClient\Query\SqlMethodCallConverter.cs (40)
728
Expression
source = sox.SourceExpression;
782
Expression
source = sox.SourceExpression;
900
Expression
source = mc.SourceExpression;
1011
Expression
source = mc.SourceExpression;
1041
private SqlExpression CreateComparison(SqlExpression a, SqlExpression b,
Expression
source) {
1055
Expression
source = mc.SourceExpression;
1117
Expression
source = mc.SourceExpression;
1176
Expression
source = mc.SourceExpression;
1392
Expression
source = mc.SourceExpression;
1446
Expression
source = mc.SourceExpression;
1491
private SqlExpression CreateFunctionCallStatic1(Type type, string functionName, List<SqlExpression> arguments,
Expression
source) {
1495
private SqlExpression CreateFunctionCallStatic2(Type type, string functionName, List<SqlExpression> arguments,
Expression
source) {
1500
Expression
source = mc.SourceExpression;
1519
Expression
.Lambda(
1520
Expression
.Invoke(
Expression
.Constant(getStringContainsPatternForced), cp.Accessor.Body,
Expression
.Constant('~')),
1553
Expression
.Lambda(
1554
Expression
.Invoke(
Expression
.Constant(getStringStartsWithPatternForced), cp.Accessor.Body,
Expression
.Constant('~')),
1587
Expression
.Lambda(
1588
Expression
.Invoke(
Expression
.Constant(getStringEndsWithPatternForced), cp.Accessor.Body,
Expression
.Constant('~')),
1975
Expression
source = mc.SourceExpression;
2166
Expression
source = m.SourceExpression;
2340
private SqlExpression CreateDateTimeFromDateAndTicks(SqlExpression sqlDate, SqlExpression sqlTicks,
Expression
source) {
2344
private SqlExpression CreateDateTimeFromDateAndTicks(SqlExpression sqlDate, SqlExpression sqlTicks,
Expression
source, bool asNullable) {
2350
private SqlExpression CreateDateTimeFromDateAndMs(SqlExpression sqlDate, SqlExpression ms,
Expression
source) {
2354
private SqlExpression CreateDateTimeFromDateAndMs(SqlExpression sqlDate, SqlExpression ms,
Expression
source, bool asNullable) {
2361
private SqlExpression CreateDateTimeOffsetFromDateAndTicks(SqlExpression sqlDate, SqlExpression sqlTicks,
Expression
source) {
2365
private SqlExpression CreateDateTimeOffsetFromDateAndTicks(SqlExpression sqlDate, SqlExpression sqlTicks,
Expression
source, bool asNullable) {
2371
private SqlExpression CreateDateTimeOffsetFromDateAndMs(SqlExpression sqlDate, SqlExpression ms,
Expression
source) {
2375
private SqlExpression CreateDateTimeOffsetFromDateAndMs(SqlExpression sqlDate, SqlExpression ms,
Expression
source, bool asNullable) {
2382
Expression
source = mc.SourceExpression;
2474
Expression
source = mc.SourceExpression;
2486
Expression
.Lambda(
2487
Expression
.Call(typeof(SqlHelpers), "TranslateVBLikePattern", Type.EmptyTypes, cp.Accessor.Body,
Expression
.Constant('~')),
SqlClient\Query\SqlReorderer.cs (1)
100
Expression
sourceExpression;
SqlClient\Query\Translator.cs (51)
27
internal SqlSelect BuildDefaultQuery(MetaType rowType, bool allowDeferred, SqlLink link,
Expression
source) {
41
internal SqlExpression BuildProjection(SqlExpression item, MetaType rowType, bool allowDeferred, SqlLink link,
Expression
source) {
88
private SqlNew BuildProjectionInternal(SqlExpression item, MetaType rowType, IEnumerable<MetaDataMember> members, bool allowDeferred, SqlLink link,
Expression
source) {
118
private SqlLink BuildLink(SqlExpression item, MetaDataMember member,
Expression
source) {
148
internal static
Expression
TranslateAssociation(DataContext context, MetaAssociation association,
Expression
otherSource,
Expression
[] keyValues,
Expression
thisInstance) {
164
internal static
Expression
WhereClauseFromSourceAndKeys(
Expression
source, MetaDataMember[] keyMembers,
Expression
[] keyValues) {
166
ParameterExpression p =
Expression
.Parameter(elementType, "p");
167
Expression
whereExpression=null;
170
Expression
parameterAsDeclaring = elementType == metaMember.Member.DeclaringType ?
171
(
Expression
)p : (
Expression
)
Expression
.Convert(p, metaMember.Member.DeclaringType);
172
Expression
memberExpression = (metaMember.Member is FieldInfo)
173
?
Expression
.Field(parameterAsDeclaring, (FieldInfo)metaMember.Member)
174
:
Expression
.Property(parameterAsDeclaring, (PropertyInfo)metaMember.Member);
175
Expression
keyValue = keyValues[i];
177
keyValue =
Expression
.Convert(keyValue, memberExpression.Type);
178
Expression
memberEqualityExpression =
Expression
.Equal(memberExpression, keyValue);
180
?
Expression
.And(whereExpression, memberEqualityExpression)
183
Expression
sequenceExpression =
Expression
.Call(typeof(Enumerable), "Where", new Type[] {p.Type}, source,
Expression
.Lambda(whereExpression, p));
193
Expression
otherSouce;
194
Expression
parameterReplacement;
195
internal RelationComposer(ParameterExpression parameter, MetaAssociation association,
Expression
otherSouce,
Expression
parameterReplacement) {
209
internal override
Expression
VisitParameter(ParameterExpression p) {
216
private static
Expression
[] GetKeyValues(
Expression
expr, ReadOnlyCollection<MetaDataMember> keys) {
217
List<
Expression
> values = new List<
Expression
>();
219
values.Add(
Expression
.PropertyOrField(expr, key.Name));
224
internal override
Expression
VisitMemberAccess(MemberExpression m) {
226
Expression
[] keyValues = GetKeyValues(this.Visit(m.Expression), this.association.ThisKey);
229
Expression
exp = this.Visit(m.Expression);
232
return
Expression
.Call(typeof(Enumerable), "Count", new Type[] {TypeSystem.GetElementType(exp.Type)}, exp);
234
return
Expression
.MakeMemberAccess(exp, m.Member);
249
Expression
source = new LinkedTableExpression(link, table, typeof(IQueryable<>).MakeGenericType(otherType.Type));
251
Expression
[] keyExprs = new
Expression
[keyExpressions.Count];
257
Expression
lex = link.Expression != null
258
? (
Expression
)InternalExpression.Known(link.Expression)
259
: (
Expression
)
Expression
.Constant(null, link.Member.Member.DeclaringType);
260
Expression
expr = TranslateAssociation(this.services.Context, mm.Association, source, keyExprs, lex);
SqlClient\SqlProvider.cs (15)
802
ICompiledQuery IProvider.Compile(
Expression
query) {
849
IExecuteResult IProvider.Execute(
Expression
query) {
991
private IExecuteResult ExecuteAll(
Expression
query, QueryInfo[] queryInfos, IObjectReaderFactory factory, object[] userArguments, ICompiledSubQuery[] subQueries) {
1009
private IExecuteResult GetCachedResult(
Expression
query) {
1029
private IExecuteResult Execute(
Expression
query, QueryInfo queryInfo, IObjectReaderFactory factory, object[] parentArgs, object[] userArgs, ICompiledSubQuery[] subQueries, object lastResult) {
1140
private MetaFunction GetFunction(
Expression
query) {
1242
string IProvider.GetQueryText(
Expression
query) {
1271
DbCommand IProvider.GetCommand(
Expression
query) {
1327
private ResultShape GetResultShape(
Expression
query) {
1393
private Type GetResultType(
Expression
query) {
1401
internal QueryInfo[] BuildQuery(
Expression
query, SqlNodeAnnotations annotations) {
1666
Expression
tmp =
Expression
.Constant(null);
1687
Expression
query;
1692
internal CompiledQuery(SqlProvider provider,
Expression
query, QueryInfo[] queryInfos, IObjectReaderFactory factory, ICompiledSubQuery[] subQueries) {
System.Data.Services (709)
parent\Client\System\Data\Services\Client\ALinq\ALinqExpressionVisitor.cs (58)
99
internal virtual
Expression
Visit(
Expression
exp)
202
ReadOnlyCollection<
Expression
> arguments = this.VisitExpressionList(initializer.Arguments);
205
return
Expression
.ElementInit(initializer.AddMethod, arguments);
216
internal virtual
Expression
VisitUnary(UnaryExpression u)
218
Expression
operand = this.Visit(u.Operand);
221
return
Expression
.MakeUnary(u.NodeType, operand, u.Type, u.Method);
232
internal virtual
Expression
VisitBinary(BinaryExpression b)
234
Expression
left = this.Visit(b.Left);
235
Expression
right = this.Visit(b.Right);
236
Expression
conversion = this.Visit(b.Conversion);
241
return
Expression
.Coalesce(left, right, conversion as LambdaExpression);
245
return
Expression
.MakeBinary(b.NodeType, left, right, b.IsLiftedToNull, b.Method);
257
internal virtual
Expression
VisitTypeIs(TypeBinaryExpression b)
259
Expression
expr = this.Visit(b.Expression);
262
return
Expression
.TypeIs(expr, b.TypeOperand);
273
internal virtual
Expression
VisitConstant(ConstantExpression c)
283
internal virtual
Expression
VisitConditional(ConditionalExpression c)
285
Expression
test = this.Visit(c.Test);
286
Expression
iftrue = this.Visit(c.IfTrue);
287
Expression
iffalse = this.Visit(c.IfFalse);
290
return
Expression
.Condition(test, iftrue, iffalse);
301
internal virtual
Expression
VisitParameter(ParameterExpression p)
311
internal virtual
Expression
VisitMemberAccess(MemberExpression m)
313
Expression
exp = this.Visit(m.Expression);
316
return
Expression
.MakeMemberAccess(exp, m.Member);
327
internal virtual
Expression
VisitMethodCall(MethodCallExpression m)
329
Expression
obj = this.Visit(m.Object);
330
IEnumerable<
Expression
> args = this.VisitExpressionList(m.Arguments);
333
return
Expression
.Call(obj, m.Method, args);
344
internal virtual ReadOnlyCollection<
Expression
> VisitExpressionList(ReadOnlyCollection<
Expression
> original)
346
List<
Expression
> list = null;
349
Expression
p = this.Visit(original[i]);
356
list = new List<
Expression
>(n);
368
return new ReadOnlyCollection<
Expression
>(list);
381
Expression
e = this.Visit(assignment.Expression);
384
return
Expression
.Bind(assignment.Member, e);
400
return
Expression
.MemberBind(binding.Member, bindings);
416
return
Expression
.ListBind(binding.Member, initializers);
497
internal virtual
Expression
VisitLambda(LambdaExpression lambda)
499
Expression
body = this.Visit(lambda.Body);
503
return
Expression
.Lambda(lambda.Type, body, lambda.Parameters);
521
IEnumerable<
Expression
> args = this.VisitExpressionList(nex.Arguments);
526
return
Expression
.New(nex.Constructor, args, nex.Members);
530
return
Expression
.New(nex.Constructor, args);
542
internal virtual
Expression
VisitMemberInit(MemberInitExpression init)
548
return
Expression
.MemberInit(n, bindings);
559
internal virtual
Expression
VisitListInit(ListInitExpression init)
565
return
Expression
.ListInit(n, initializers);
576
internal virtual
Expression
VisitNewArray(NewArrayExpression na)
578
IEnumerable<
Expression
> exprs = this.VisitExpressionList(na.Expressions);
583
return
Expression
.NewArrayInit(na.Type.GetElementType(), exprs);
587
return
Expression
.NewArrayBounds(na.Type.GetElementType(), exprs);
599
internal virtual
Expression
VisitInvocation(InvocationExpression iv)
601
IEnumerable<
Expression
> args = this.VisitExpressionList(iv.Arguments);
602
Expression
expr = this.Visit(iv.Expression);
605
return
Expression
.Invoke(expr, args);
parent\Client\System\Data\Services\Client\ALinq\ParameterReplacerVisitor.cs (6)
20
private
Expression
newExpression;
28
private ParameterReplacerVisitor(ParameterExpression oldParameter,
Expression
newExpression)
42
internal static
Expression
Replace(
Expression
expression, ParameterExpression oldParameter,
Expression
newExpression)
53
internal override
Expression
VisitParameter(ParameterExpression p)
System\Data\Services\DataServiceConfiguration.cs (8)
473
internal static
Expression
ComposeQueryInterceptors(IDataService service, ResourceSetWrapper container)
486
Expression
predicate = null;
489
predicate = (
Expression
)methods[i].Invoke(service.Instance, WebUtil.EmptyObjectArray);
510
Expression
adjustedPredicate = ParameterReplacerVisitor.Replace(
514
filter =
Expression
.Lambda(
Expression
.And(filter.Body, adjustedPredicate), parameter);
541
Expression
predicate = null;
544
predicate = (
Expression
)methods[i].Invoke(service.Instance, WebUtil.EmptyObjectArray);
System\Data\Services\ExpandSegment.cs (5)
47
private readonly
Expression
filter;
70
public ExpandSegment(string name,
Expression
filter)
87
Expression
filter,
108
public
Expression
Filter
189
private static void CheckFilterType(
Expression
filter)
System\Data\Services\Internal\NeedSkipTokenVisitor.cs (4)
130
internal override
Expression
Visit(
Expression
exp)
153
internal override
Expression
VisitMemberAccess(MemberExpression m)
180
internal override
Expression
VisitParameter(ParameterExpression p)
System\Data\Services\Internal\ProjectedWrapper.cs (22)
155
internal static MemberBinding[] Bind(
Expression
[] bindingExpressions, Type projectedWrapperType)
274
Expression
[] bindingExpressions)
280
bindings[0] =
Expression
.Bind(projectedWrapperType.GetProperty("ResourceTypeName"), bindingExpressions[0]);
281
bindings[1] =
Expression
.Bind(projectedWrapperType.GetProperty("PropertyNameList"), bindingExpressions[1]);
289
private static MemberAssignment BindToProjectedProperty(Type projectedWrapperType, int propertyIndex,
Expression
expression)
298
return
Expression
.Bind(
309
Expression
[] bindingExpressions,
339
nextBindings[0] =
Expression
.Bind(
341
Expression
.Constant(string.Empty, typeof(string)));
342
nextBindings[1] =
Expression
.Bind(
344
Expression
.Constant(string.Empty, typeof(string)));
350
Expression
restProjectedWrapper =
Expression
.MemberInit(
351
Expression
.New(typeof(ProjectedWrapperMany)),
353
bindings[bindingStartIndex + precreatedProjectedWrapperTypes.Length - 1] =
Expression
.Bind(
369
Expression
.Constant(string.Empty, typeof(string)));
378
bindings[bindingStartIndex + precreatedProjectedWrapperTypes.Length - 1] =
Expression
.Bind(
380
Expression
.MemberInit(
381
Expression
.New(typeof(ProjectedWrapperManyEnd)),
382
Expression
.Bind(
384
Expression
.Constant(string.Empty, typeof(string)))));
413
public
Expression
Expression
System\Data\Services\Internal\PropertyAccessVisitor.cs (10)
34
internal override
Expression
VisitMethodCall(MethodCallExpression m)
65
Expression
operand = m.Arguments[0];
66
Expression
result = m;
74
return
Expression
.Call(m.Object, m.Method, operand, m.Arguments[1]);
91
internal override
Expression
VisitMemberAccess(MemberExpression m)
95
Expression
operand = m.Expression;
96
Expression
result = m;
101
return
Expression
.MakeMemberAccess(operand, m.Member);
137
ref
Expression
operandExpression,
138
ref
Expression
accessExpression);
System\Data\Services\OpenTypes\OpenTypeMethods.cs (61)
534
internal static
Expression
AddExpression(
Expression
left,
Expression
right)
536
return
Expression
.Add(
545
internal static
Expression
AndAlsoExpression(
Expression
left,
Expression
right)
547
return
Expression
.Call(
556
internal static
Expression
DivideExpression(
Expression
left,
Expression
right)
558
return
Expression
.Divide(
567
internal static
Expression
EqualExpression(
Expression
left,
Expression
right)
569
return
Expression
.Equal(
579
internal static
Expression
GreaterThanExpression(
Expression
left,
Expression
right)
581
return
Expression
.GreaterThan(
591
internal static
Expression
GreaterThanOrEqualExpression(
Expression
left,
Expression
right)
593
return
Expression
.GreaterThanOrEqual(
603
internal static
Expression
LessThanExpression(
Expression
left,
Expression
right)
605
return
Expression
.LessThan(
615
internal static
Expression
LessThanOrEqualExpression(
Expression
left,
Expression
right)
617
return
Expression
.LessThanOrEqual(
627
internal static
Expression
ModuloExpression(
Expression
left,
Expression
right)
629
return
Expression
.Modulo(
638
internal static
Expression
MultiplyExpression(
Expression
left,
Expression
right)
640
return
Expression
.Multiply(
649
internal static
Expression
OrElseExpression(
Expression
left,
Expression
right)
651
return
Expression
.Call(
660
internal static
Expression
NotEqualExpression(
Expression
left,
Expression
right)
662
return
Expression
.NotEqual(
672
internal static
Expression
SubtractExpression(
Expression
left,
Expression
right)
674
return
Expression
.Subtract(
683
internal static
Expression
NegateExpression(
Expression
expression)
685
return
Expression
.Negate(
693
internal static
Expression
NotExpression(
Expression
expression)
695
return
Expression
.Not(
713
private static
Expression
ExpressionAsObject(
Expression
expression)
716
return expression.Type.IsValueType ?
Expression
.Convert(expression, typeof(object)) : expression;
System\Data\Services\Parsing\FunctionDescription.cs (76)
44
private Func<
Expression
,
Expression
[],
Expression
> conversionFunction;
58
public FunctionDescription(string name, Type[] parameterTypes, Func<
Expression
,
Expression
[],
Expression
> conversionFunction)
71
Func<
Expression
,
Expression
[],
Expression
> conversionFunction,
82
public Func<
Expression
,
Expression
[],
Expression
> ConversionFunction
122
public
Expression
InstanceMethodConversionFunction(
Expression
target,
Expression
[] arguments)
124
Expression
instanceArgument = arguments[0];
125
Expression
[] methodArguments = new
Expression
[arguments.Length - 1];
127
return
Expression
.Call(instanceArgument, (MethodInfo)this.member, methodArguments);
134
public
Expression
StaticMethodConversionFunction(
Expression
target,
Expression
[] arguments)
136
return
Expression
.Call((MethodInfo)this.member, arguments);
143
public
Expression
InstancePropertyConversionFunction(
Expression
target,
Expression
[] arguments)
145
return
Expression
.Property(arguments[0], (PropertyInfo)this.member);
153
public
Expression
InvokeOpenTypeMethod(
Expression
[] arguments)
172
return
Expression
.Call(null, methodInfo, arguments);
308
internal static
Expression
SubstringOf(
Expression
target,
Expression
[] arguments)
317
return
Expression
.Call(arguments[1], method, arguments[0]);
324
internal static
Expression
UnaryIsOf(
Expression
target,
Expression
[] arguments)
327
return
Expression
.TypeIs(target, (Type)ce.Value);
334
internal static
Expression
BinaryIsOf(
Expression
target,
Expression
[] arguments)
337
return
Expression
.TypeIs(arguments[0], (Type)ce.Value);
344
internal static
Expression
UnaryIsOfResourceType(
Expression
target,
Expression
[] arguments)
350
return
Expression
.Call(null, DataServiceProviderMethods.TypeIsMethodInfo, target, arguments[0]);
357
internal static
Expression
BinaryIsOfResourceType(
Expression
target,
Expression
[] arguments)
367
return
Expression
.Call(null, callOpenTypeMethod ? OpenTypeMethods.TypeIsMethodInfo : DataServiceProviderMethods.TypeIsMethodInfo, arguments[0], arguments[1]);
374
internal static
Expression
UnaryCast(
Expression
target,
Expression
[] arguments)
378
return
Expression
.Convert(target, (Type)ce.Value);
385
internal static
Expression
BinaryCast(
Expression
target,
Expression
[] arguments)
400
return
Expression
.Constant(null, targetType);
403
return
Expression
.Convert(arguments[0], targetType);
410
internal static
Expression
UnaryCastResourceType(
Expression
target,
Expression
[] arguments)
416
return
Expression
.Call(null, DataServiceProviderMethods.ConvertMethodInfo, target, arguments[0]);
423
internal static
Expression
BinaryCastResourceType(
Expression
target,
Expression
[] arguments)
433
return
Expression
.Call(null, callOpenTypeMethod ? OpenTypeMethods.ConvertMethodInfo : DataServiceProviderMethods.ConvertMethodInfo, arguments[0], arguments[1]);
486
result.ConversionFunction = new Func<
Expression
,
Expression
[],
Expression
>(result.InstanceMethodConversionFunction);
490
result.ConversionFunction = new Func<
Expression
,
Expression
[],
Expression
>(result.StaticMethodConversionFunction);
496
result.ConversionFunction = new Func<
Expression
,
Expression
[],
Expression
>(result.InstancePropertyConversionFunction);
System\Data\Services\Parsing\RequestQueryParser.cs (246)
45
Expression
queryExpr = source.Expression;
54
queryExpr =
Expression
.Call(
59
Expression
.Quote(selectorLambda));
85
Expression
.Call(typeof(Queryable), "Where", new Type[] { source.ElementType }, source.Expression,
Expression
.Quote(lambda)));
108
ParameterExpression parameterForIt =
Expression
.Parameter(queryElementType, "it");
110
return
Expression
.Lambda(parser.ParseWhere(), parameterForIt);
137
private static readonly
Expression
[] emptyExpressions = new
Expression
[0];
140
private static readonly ConstantExpression trueLiteral =
Expression
.Constant(true);
143
private static readonly ConstantExpression falseLiteral =
Expression
.Constant(false);
194
private Dictionary<
Expression
, string> literals;
236
this.literals = new Dictionary<
Expression
, string>(ReferenceEqualityComparer<
Expression
>.Instance);
254
internal
Expression
ParseWhere()
257
Expression
expr = this.ParseExpression();
275
ParameterExpression element =
Expression
.Parameter(this.typeForIt.InstanceType, "element");
276
Expression
lastCondition =
Expression
.Constant(true, typeof(bool));
277
Expression
lastMatch =
Expression
.Constant(false, typeof(bool));
283
Expression
fixedLambda = System.Data.Services.Client.ParameterReplacerVisitor.Replace(
288
Expression
comparison = GenerateLogicalAnd(
303
return
Expression
.Lambda(lastMatch, element);
313
Expression
expr = this.ParseExpression();
344
Expression
e = this.ParsePrimaryStart(l);
356
private static
Expression
PrepareExpressionForWhere(
Expression
expr)
360
expr = OpenTypeMethods.EqualExpression(expr,
Expression
.Constant(true, typeof(object)));
361
expr =
Expression
.Convert(expr, typeof(bool));
369
Expression
test =
Expression
.Equal(expr,
Expression
.Constant(null, typeof(bool?)));
370
expr =
Expression
.Condition(test, falseLiteral,
Expression
.Property(expr, "Value"));
525
private static MethodData[] FindBestApplicableMethods(MethodData[] applicable,
Expression
[] args)
763
private static bool IsBetterThan(
Expression
[] args, IEnumerable<Type> firstCandidate, IEnumerable<Type> secondCandidate)
799
private static bool IsBetterThan(
Expression
[] args, MethodData m1, MethodData m2)
886
private static
Expression
GenerateEqual(
Expression
left,
Expression
right)
895
return
Expression
.Equal(left, right, false, ExpressionParser.ByteArrayEqualMethod);
898
return
Expression
.Equal(left, right);
905
private static
Expression
GenerateNotEqual(
Expression
left,
Expression
right)
914
return
Expression
.NotEqual(left, right, false, ExpressionParser.ByteArrayNotEqualMethod);
917
return
Expression
.NotEqual(left, right);
925
private static
Expression
GenerateGreaterThan(
Expression
left,
Expression
right, MethodInfo comparisonMethodInfo)
934
left =
Expression
.Call(null, comparisonMethodInfo, left, right);
935
right =
Expression
.Constant(0, typeof(int));
938
return
Expression
.GreaterThan(left, right);
946
private static
Expression
GenerateGreaterThanEqual(
Expression
left,
Expression
right, MethodInfo comparisonMethodInfo)
955
left =
Expression
.Call(null, comparisonMethodInfo, left, right);
956
right =
Expression
.Constant(0, typeof(int));
959
return
Expression
.GreaterThanOrEqual(left, right);
967
private static
Expression
GenerateLessThan(
Expression
left,
Expression
right, MethodInfo comparisonMethodInfo)
976
left =
Expression
.Call(null, comparisonMethodInfo, left, right);
977
right =
Expression
.Constant(0, typeof(int));
980
return
Expression
.LessThan(left, right);
988
private static
Expression
GenerateLessThanEqual(
Expression
left,
Expression
right, MethodInfo comparisonMethodInfo)
997
left =
Expression
.Call(null, comparisonMethodInfo, left, right);
998
right =
Expression
.Constant(0, typeof(int));
1001
return
Expression
.LessThanOrEqual(left, right);
1087
private static
Expression
GenerateAdd(
Expression
left,
Expression
right)
1094
return
Expression
.Add(left, right);
1101
private static
Expression
GenerateSubtract(
Expression
left,
Expression
right)
1108
return
Expression
.Subtract(left, right);
1115
private static
Expression
GenerateMultiply(
Expression
left,
Expression
right)
1122
return
Expression
.Multiply(left, right);
1128
private static
Expression
GenerateNegate(
Expression
expr)
1135
return
Expression
.Negate(expr);
1141
private static
Expression
GenerateNot(
Expression
expr)
1151
return
Expression
.Not(expr);
1163
private static
Expression
GenerateDivide(
Expression
left,
Expression
right)
1170
return
Expression
.Divide(left, right);
1177
private static
Expression
GenerateModulo(
Expression
left,
Expression
right)
1184
return
Expression
.Modulo(left, right);
1191
private static
Expression
GenerateLogicalAnd(
Expression
left,
Expression
right)
1198
return
Expression
.AndAlso(left, right);
1205
private static
Expression
GenerateLogicalOr(
Expression
left,
Expression
right)
1212
return
Expression
.OrElse(left, right);
1218
/// <param name="expression">Non-null <see cref="
Expression
"/> to check.</param>
1220
private static bool IsOpenPropertyExpression(
Expression
expression)
1229
private static bool IsOpenExpression(
Expression
input)
1279
private static
Expression
StripObjectConvert(
Expression
input)
1296
private static MethodInfo GetStaticMethod(string methodName,
Expression
left,
Expression
right)
1306
private static
Expression
GenerateStaticMethodCall(string methodName,
Expression
left,
Expression
right)
1308
return
Expression
.Call(null, GetStaticMethod(methodName, left, right), new
Expression
[] { left, right });
1334
private static Exception IncompatibleOperandsError(string operationName,
Expression
left,
Expression
right, int pos)
1349
private static
Expression
ParseNullLiteral(ExpressionLexer l)
1358
private
Expression
ParseExpression()
1361
Expression
expr = this.ParseLogicalOr();
1368
private
Expression
ParseLogicalOr()
1371
Expression
left = this.ParseLogicalAnd();
1376
Expression
right = this.ParseLogicalAnd();
1387
private
Expression
ParseLogicalAnd()
1390
Expression
left = this.ParseComparison();
1395
Expression
right = this.ParseComparison();
1406
private
Expression
ParseComparison()
1409
Expression
left = this.ParseAdditive();
1414
Expression
right = this.ParseAdditive();
1429
private
Expression
GenerateComparison(
Expression
left, String rightLiteral, Token op)
1445
private
Expression
GenerateNullAwareComparison(
Expression
left, String rightLiteral, Token op)
1452
Expression
right = this.ParsePrimaryStart(l);
1458
right =
Expression
.Convert(right, typeof(Nullable<>).MakeGenericType(right.Type));
1463
left =
Expression
.Convert(left, typeof(Nullable<>).MakeGenericType(left.Type));
1479
return
Expression
.Constant(false, typeof(bool));
1483
return GenerateNotEqual(left,
Expression
.Constant(null, left.Type));
1488
GenerateNotEqual(left,
Expression
.Constant(null, left.Type)),
1490
GenerateEqual(right,
Expression
.Constant(null, right.Type)),
1498
return
Expression
.Constant(false, typeof(bool));
1502
return GenerateNotEqual(right,
Expression
.Constant(null, right.Type));
1507
GenerateNotEqual(right,
Expression
.Constant(null, left.Type)),
1509
GenerateEqual(left,
Expression
.Constant(null, right.Type)),
1528
private
Expression
GenerateComparisonExpression(
Expression
left,
Expression
right, Token op)
1537
left =
Expression
.Constant(null, right.Type);
1541
right =
Expression
.Constant(null, left.Type);
1545
right =
Expression
.Convert(right, left.Type);
1549
left =
Expression
.Convert(left, right.Type);
1569
left =
Expression
.Convert(left, typeof(Nullable<>).MakeGenericType(left.Type));
1573
right =
Expression
.Convert(right, typeof(Nullable<>).MakeGenericType(right.Type));
1642
private
Expression
ParseAdditive()
1645
Expression
left = this.ParseMultiplicative();
1651
Expression
right = this.ParseMultiplicative();
1671
private
Expression
ParseMultiplicative()
1674
Expression
left = this.ParseUnary();
1681
Expression
right = this.ParseUnary();
1704
private
Expression
ParseUnary()
1721
Expression
expr = this.ParseUnary();
1743
private
Expression
ParsePrimary()
1746
Expression
expr = this.ParsePrimaryStart(this.lexer);
1767
private
Expression
ParsePrimaryStart(ExpressionLexer l)
1806
private
Expression
ParseParenExpression()
1814
Expression
e = this.ParseExpression();
1826
private
Expression
ParseIdentifier()
1845
private
Expression
ParseIdentifierAsFunction()
1860
Expression
[] originalArguments = this.ParseArgumentList();
1861
Expression
[] arguments = this.nullPropagationRequired ? originalArguments : (
Expression
[])originalArguments.Clone();
1862
Expression
candidateTypeArgument = arguments.Length > 1 ? arguments[1] :
1871
foreach (
Expression
argument in arguments)
1881
Expression
result = null;
1894
Expression
[] openArguments = new
Expression
[arguments.Length];
1903
openArguments[i] =
Expression
.Convert(arguments[i], typeof(object));
1933
Expression
typeExpression = arguments[arguments.Length - 1];
1940
arguments[arguments.Length - 1] =
Expression
.Constant(typeof(Nullable<>).MakeGenericType(castTargetType));
1945
Expression
[] finalArguments;
1949
finalArguments = new
Expression
[arguments.Length + 1];
1955
finalArguments[arguments.Length] =
Expression
.Constant(IsOpenPropertyExpression(arguments[0]), typeof(bool));
1994
private
Expression
ParseBooleanLiteral()
2015
private
Expression
ParseTypedLiteral(Type targetType, string targetTypeName, ExpressionLexer l)
2024
Expression
result = this.CreateLiteral(targetValue, l.CurrentToken.Text);
2032
private
Expression
ParseMemberAccess(
Expression
instance)
2065
Expression
propertyAccess;
2068
propertyAccess =
Expression
.Property(instance, this.currentSegmentInfo.ResourceType.GetPropertyInfo(property));
2073
propertyAccess =
Expression
.Call(
2077
Expression
.Constant(property));
2078
propertyAccess =
Expression
.Convert(propertyAccess, property.Type);
2081
Expression
result = this.ConsiderNullPropagation(instance, propertyAccess);
2086
Expression
filter = DataServiceConfiguration.ComposeQueryInterceptors(this.service, container);
2112
Expression
call =
2113
Expression
.Call(null /* instance */, OpenTypeMethods.GetValueOpenPropertyMethodInfo, instance,
Expression
.Constant(id));
2125
private
Expression
[] ParseArgumentList()
2133
Expression
[] args = this.CurrentToken.Id != TokenId.CloseParen ? this.ParseArguments() : emptyExpressions;
2145
private
Expression
[] ParseArguments()
2147
List<
Expression
> argList = new List<
Expression
>();
2168
private
Expression
CreateLiteral(object value, string text)
2173
ConstantExpression expr =
Expression
.Constant(value);
2182
private FunctionDescription FindBestFunction(FunctionDescription[] functions, ref
Expression
[] arguments)
2186
List<
Expression
[]> applicablePromotedArguments = new List<
Expression
[]>(functions.Length);
2196
Expression
[] promotedArguments = new
Expression
[arguments.Length];
2270
private
Expression
ConsiderNullPropagation(
Expression
element,
Expression
notNullExpression)
2286
Expression
test =
Expression
.Equal(element,
Expression
.Constant(null, element.Type));
2287
Expression
falseIf = notNullExpression;
2290
falseIf =
Expression
.Convert(falseIf, typeof(Nullable<>).MakeGenericType(falseIf.Type));
2293
Expression
trueIf =
Expression
.Constant(null, falseIf.Type);
2294
return
Expression
.Condition(test, trueIf, falseIf);
2302
private void CheckAndPromoteOperand(Type signatures, string operationName, ref
Expression
expr, int errorPos)
2306
Expression
[] args = new
Expression
[] { expr };
2322
private void CheckAndPromoteOperands(Type signatures, string operationName, ref
Expression
left, ref
Expression
right, int errorPos)
2324
Expression
[] args = new
Expression
[] { left, right };
2341
private int FindMethod(Type type, string methodName,
Expression
[] args, out MethodBase method)
2362
private MethodData[] FindApplicableMethods(IEnumerable<MethodBase> methods,
Expression
[] args)
2382
private int FindBestMethod(IEnumerable<MethodBase> methods,
Expression
[] args, out MethodBase method)
2436
private bool IsApplicable(MethodData method,
Expression
[] args)
2443
Expression
[] promotedArgs = new
Expression
[args.Length];
2448
Expression
promoted = this.PromoteExpression(args[i], pi.ParameterType, false);
2466
private
Expression
PromoteExpression(
Expression
expr, Type type, bool exact)
2482
return
Expression
.Constant(null, type);
2536
return
Expression
.Constant(value, type);
2546
return
Expression
.Convert(expr, type);
2555
Expression
valueAccessExpression =
Expression
.Property(expr, "Value");
2610
private
Expression
[] args;
2630
public
Expression
[] Args
System\Data\Services\Providers\BasicExpandProvider.cs (127)
214
Expression
expression = query.Expression;
217
ParameterExpression parameter =
Expression
.Parameter(elementType, "p");
218
Expression
replaceExpression = parameter;
227
replaceExpression =
Expression
.Property(parameter, "ExpandedElement");
236
orderer =
Expression
.Lambda(ParameterReplacerVisitor.Replace(e.Body, e.Parameters[0], replaceExpression), parameter);
265
Expression
expression = query.Expression;
268
ParameterExpression parameter =
Expression
.Parameter(elementType, "p");
276
orderer =
Expression
.Lambda(
379
public
Expression
Expression
968
Dictionary<
Expression
, ExpandNode> expandNodeAnnotations =
1190
private static LambdaExpression BuildLambdaExpression(Type delegateType,
Expression
body, IEnumerable<ParameterExpression> parameters)
1194
return
Expression
.Lambda(delegateType, body, parameters);
1248
private static
Expression
AccessProperty(
Expression
source, ResourceType resourceType, ResourceProperty property, bool nullPropagationRequired)
1255
Expression
expression;
1258
expression =
Expression
.Property(source, resourceType.GetPropertyInfo(property));
1265
expression =
Expression
.Call(null /* instance */, getter, source,
Expression
.Constant(property));
1269
expression =
Expression
.Call(
1273
Expression
.Constant(property));
1274
expression =
Expression
.Convert(expression, property.Type);
1285
expression =
Expression
.Convert(expression, WebUtil.GetTypeAllowingNull(expression.Type));
1288
expression =
Expression
.Condition(
1289
Expression
.Equal(source,
Expression
.Constant(null, source.Type)),
1290
Expression
.Constant(null, expression.Type),
1304
private static
Expression
AccessOpenProperty(
Expression
source, string propertyName)
1309
Expression
expression =
Expression
.Call(
1313
Expression
.Constant(propertyName));
1328
private static MemberAssignment BindByName(Type type, string propertyName,
Expression
source)
1333
return
Expression
.Bind(member, source);
1339
private
Expression
ApplySegmentFilter(
Expression
expression)
1361
Expression
[] arguments = new
Expression
[] { expression, this.Node.Filter };
1362
expression =
Expression
.Call(null, method, arguments);
1369
ConstantExpression count =
Expression
.Constant((int)this.Node.MaxResultsExpected + 1, typeof(int));
1370
Expression
[] arguments = new
Expression
[] { expression, count };
1371
expression =
Expression
.Call(null, method, arguments);
1383
private
Expression
BuildProjectionExpression(
Expression
expression)
1398
Expression
parameter = this.singleResult ? expression :
Expression
.Parameter(expressionElementType, "p");
1399
Expression
body;
1416
Expression
source = expression;
1420
Expression
[] arguments = new
Expression
[] { source, selector };
1422
expression =
Expression
.Call(null, method, arguments);
1433
private
Expression
BuildProjectionExpressionForExpandedWrapper(
Expression
source)
1443
bindings[1] = BindByName(this.elementType, "Description",
Expression
.Constant(this.WrapperDescription));
1451
Expression
propertyAccess = node.BuildProjectionExpression(
1488
propertyAccess =
Expression
.Condition(
1489
Expression
.Equal(source,
Expression
.Constant(null, source.Type)),
1490
Expression
.Constant(null, propertyAccess.Type),
1508
skipTokenPropertyBindings[0] = BindByName(projectedSkipTokenType, "ExpandedElement",
Expression
.Constant((string)null, typeof(string)));
1515
Expression
orderExpression = ParameterReplacerVisitor.Replace(orderLamba.Body, orderLamba.Parameters[0], source);
1517
skipTokenPropertyBindings[i + 2] =
Expression
.Bind(member, orderExpression);
1520
skipTokenPropertyBindings[1] = BindByName(projectedSkipTokenType, "Description",
Expression
.Constant(skipTokenDescription.Remove(skipTokenDescription.Length - 1, 1).ToString()));
1522
Expression
skipTokenBody =
Expression
.MemberInit(
Expression
.New(projectedSkipTokenType), skipTokenPropertyBindings);
1527
Expression
.Constant((this.WrapperDescription.Length == 0 ? "" : (this.WrapperDescription + ",")) + XmlConstants.HttpQueryStringSkipToken));
1531
return
Expression
.MemberInit(
Expression
.New(this.elementType), bindings);
1538
private
Expression
BuildProjectionExpressionForProjectedWrapper(
Expression
source)
1551
Expression
expression = null;
1562
Expression
[] bindingExpressions = new
Expression
[this.projectedProperties.Count + 2];
1568
Expression
sourceExpression =
Expression
.TypeAs(source, resourceType.InstanceType);
1581
Expression
propertyAccess = null;
1595
propertyAccess =
Expression
.Convert(propertyAccess, WebUtil.GetTypeAllowingNull(resourceProperty.Type));
1620
propertyAccess =
Expression
.Constant(null, WebUtil.GetTypeAllowingNull(projectedProperty.Property.Type));
1625
propertyAccess =
Expression
.Constant(null, typeof(object));
1640
propertyAccess =
Expression
.Convert(propertyAccess, typeof(object));
1669
bindingExpressions[0] =
Expression
.Condition(
1670
Expression
.Equal(
1672
Expression
.Constant(null, source.Type)),
1673
Expression
.Constant(string.Empty, typeof(string)),
1674
Expression
.Constant(resourceType.FullName, typeof(string)));
1678
bindingExpressions[0] =
Expression
.Constant(resourceType.FullName, typeof(string));
1682
bindingExpressions[1] =
Expression
.Constant(propertyNameList.ToString());
1684
Expression
initExpression =
Expression
.MemberInit(
1685
Expression
.New(projectedWrapperType),
1695
Expression
typeIsExpression = this.ExpandProvider.Provider.IsV1Provider ?
1696
(
Expression
)
Expression
.TypeIs(source, resourceType.InstanceType) :
1697
Expression
.Call(
1701
Expression
.Constant(resourceType));
1703
expression =
Expression
.Condition(typeIsExpression, initExpression, expression);
1716
expression =
Expression
.Condition(
1717
Expression
.Equal(source,
Expression
.Constant(null, source.Type)),
1718
Expression
.Constant(null, expression.Type),
1731
private
Expression
ApplyOrderTakeOnInnerSegment(
Expression
expression)
1738
ParameterExpression parameter =
Expression
.Parameter(expressionElementType, "p");
1749
Expression
updatedOrderingBody = ParameterReplacerVisitor.Replace(
1754
expression =
Expression
.Call(
1759
Expression
.Lambda(updatedOrderingBody, parameter));
1765
return
Expression
.Call(
1770
Expression
.Constant(this.Node.MaxResultsExpected, typeof(int)));
1854
private Dictionary<
Expression
, ExpandNode> expandNodeAnnotations;
1864
this.expandNodeAnnotations = new Dictionary<
Expression
, ExpandNode>(ReferenceEqualityComparer<
Expression
>.Instance);
1873
internal static Dictionary<
Expression
, ExpandNode> AnnotateExpression(
1874
Expression
expression,
1889
internal override
Expression
VisitConditional(ConditionalExpression c)
1915
internal override
Expression
VisitUnary(UnaryExpression u)
1942
internal override
Expression
VisitParameter(ParameterExpression p)
1974
protected override bool ProcessPropertyAccess(string propertyName, ref
Expression
operandExpression, ref
Expression
accessExpression)
1994
private ExpandNode GetExpandNodeAnnotation(
Expression
expression)
2010
private void SetExpandNodeAnnotation(
Expression
expression, ExpandNode annotation)
2030
private Dictionary<
Expression
, ExpandNode> expandNodeAnnotations;
2035
Dictionary<
Expression
, ExpandNode> expandNodeAnnotations)
2047
Expression
expression,
2048
Dictionary<
Expression
, ExpandNode> expandNodeAnnotations)
2077
protected override bool ProcessPropertyAccess(string propertyName, ref
Expression
operandExpression, ref
Expression
accessExpression)
System\Data\Services\Providers\ExpandedProjectionNode.cs (3)
43
private readonly
Expression
filter;
91
Expression
filter,
124
public
Expression
Filter
System\Data\Services\Providers\OrderingExpression.cs (3)
25
private readonly
Expression
orderingExpression;
35
public OrderingExpression(
Expression
orderingExpression, bool isAscending)
42
public
Expression
Expression
System\Data\Services\Providers\RootProjectionNode.cs (1)
55
Expression
filter,
System\Data\Services\RequestQueryProcessor.cs (42)
215
internal static
Expression
ComposePropertyNavigation(
216
Expression
expression,
223
Expression
fixedFilter = ParameterReplacerVisitor.Replace(
228
Expression
test;
231
Expression
nullConstant = WebUtil.NullLiteral;
232
test =
Expression
.AndAlso(
Expression
.NotEqual(expression, nullConstant), fixedFilter);
239
Expression
conditionTrue = expression;
240
Expression
conditionFalse =
Expression
.Constant(null, conditionTrue.Type);
241
return
Expression
.Condition(test, conditionTrue, conditionFalse);
422
Expression
filter = null;
438
ParameterExpression p =
Expression
.Parameter(resourceType.InstanceType, "p");
459
Expression
e;
462
e =
Expression
.Property(p, resourceType.GetPropertyInfo(keyProp));
467
e =
Expression
.Call(
471
Expression
.Constant(keyProp));
472
e =
Expression
.Convert(e, keyProp.Type);
475
internalOrderingInfo.Add(new OrderingExpression(
Expression
.Lambda(e, p), true));
925
ParameterExpression p =
Expression
.Parameter(this.description.LastSegmentInfo.TargetResourceType.InstanceType, "it");
1078
ParameterExpression elementParameter =
Expression
.Parameter(rt.InstanceType, "element");
1091
this.topLevelOrderingInfo.Add(new OrderingExpression(
Expression
.Lambda(o.Expression, elementParameter), o.IsAscending));
1177
ParameterExpression expandParameter =
Expression
.Parameter(queryElementType, "p");
1188
resultWrapperBindings[0] =
Expression
.Bind(resultWrapperType.GetProperty("ExpandedElement"), expandParameter);
1189
resultWrapperBindings[1] =
Expression
.Bind(resultWrapperType.GetProperty("Description"),
Expression
.Constant(XmlConstants.HttpQueryStringSkipToken));
1190
resultWrapperBindings[2] =
Expression
.Bind(
1192
Expression
.MemberInit(
Expression
.New(skipTokenWrapperType), skipTokenBindings));
1194
Expression
resultBody =
Expression
.MemberInit(
Expression
.New(resultWrapperType), resultWrapperBindings);
1196
this.query = RequestUriProcessor.InvokeSelectForTypes(this.query, resultWrapperType,
Expression
.Lambda(resultBody, expandParameter));
1240
skipTokenBindings[0] =
Expression
.Bind(skipTokenWrapperType.GetProperty("ExpandedElement"), expandParameter);
1241
skipTokenBindings[1] =
Expression
.Bind(skipTokenWrapperType.GetProperty("Description"),
Expression
.Constant(skipTokenDescription.ToString()));
1247
Expression
source = ParameterReplacerVisitor.Replace(sourceLambda.Body, sourceLambda.Parameters[0], expandParameter);
1249
skipTokenBindings[i + 2] =
Expression
.Bind(member, source);
1265
ParameterExpression wrapperParameter =
Expression
.Parameter(resultWrapperType, "w");
1270
Expression
newOrdering = ParameterReplacerVisitor.Replace(
1273
Expression
.MakeMemberAccess(wrapperParameter, resultWrapperType.GetProperty("ExpandedElement")));
1275
newOrderingInfo.Add(new OrderingExpression(
Expression
.Lambda(newOrdering, wrapperParameter), ordering.IsAscending));
System\Data\Services\RequestUriProcessor.cs (35)
1048
ParameterExpression p =
Expression
.Parameter(targetType, input.Parameters[0].Name);
1050
return
Expression
.Lambda(
1116
ParameterExpression parameter =
Expression
.Parameter(query.ElementType, "element");
1117
MemberExpression body =
Expression
.Property(parameter, property.Name);
1118
LambdaExpression selector =
Expression
.Lambda(body, parameter);
1138
ParameterExpression parameter =
Expression
.Parameter(query.ElementType, "element");
1140
Expression
.ConvertChecked(
1141
Expression
.Property(parameter, property.Name),
1143
LambdaExpression selector =
Expression
.Lambda(body, parameter);
1160
ParameterExpression parameter =
Expression
.Parameter(query.ElementType, "element");
1161
Expression
body =
Expression
.Call(null /* instance */, OpenTypeMethods.GetValueOpenPropertyMethodInfo, parameter,
Expression
.Constant(propertyName));
1163
LambdaExpression selector =
Expression
.Lambda(body, parameter);
1179
ParameterExpression parameter =
Expression
.Parameter(query.ElementType, "element");
1180
Expression
body =
Expression
.Call(null /*instance*/, DataServiceProviderMethods.GetValueMethodInfo, parameter,
Expression
.Constant(property));
1181
body =
Expression
.Convert(body, property.Type);
1183
LambdaExpression selector =
Expression
.Lambda(body, parameter);
1200
ParameterExpression parameter =
Expression
.Parameter(query.ElementType, "element");
1202
Expression
body =
Expression
.Call(null /*instance*/, getter, parameter,
Expression
.Constant(property));
1203
LambdaExpression selector =
Expression
.Lambda(body, parameter);
1236
ParameterExpression parameter =
Expression
.Parameter(query.ElementType, "element");
1237
Expression
e;
1240
e =
Expression
.Property(parameter, keyProperty.Name);
1244
e =
Expression
.Call(null /*instance*/, DataServiceProviderMethods.GetValueMethodInfo, parameter,
Expression
.Constant(keyProperty));
1245
e =
Expression
.Convert(e, keyProperty.Type);
1248
BinaryExpression body =
Expression
.Equal((
Expression
)e,
Expression
.Constant(keyValue));
1249
LambdaExpression predicate =
Expression
.Lambda(body, parameter);
System\Data\Services\WebUtil.cs (2)
52
internal static readonly ConstantExpression NullLiteral =
Expression
.Constant(null);
883
internal static bool IsNullConstant(
Expression
expression)
System.Data.Services.Client (674)
System\Data\Services\Client\ALinq\ALinqExpressionVisitor.cs (58)
99
internal virtual
Expression
Visit(
Expression
exp)
202
ReadOnlyCollection<
Expression
> arguments = this.VisitExpressionList(initializer.Arguments);
205
return
Expression
.ElementInit(initializer.AddMethod, arguments);
216
internal virtual
Expression
VisitUnary(UnaryExpression u)
218
Expression
operand = this.Visit(u.Operand);
221
return
Expression
.MakeUnary(u.NodeType, operand, u.Type, u.Method);
232
internal virtual
Expression
VisitBinary(BinaryExpression b)
234
Expression
left = this.Visit(b.Left);
235
Expression
right = this.Visit(b.Right);
236
Expression
conversion = this.Visit(b.Conversion);
241
return
Expression
.Coalesce(left, right, conversion as LambdaExpression);
245
return
Expression
.MakeBinary(b.NodeType, left, right, b.IsLiftedToNull, b.Method);
257
internal virtual
Expression
VisitTypeIs(TypeBinaryExpression b)
259
Expression
expr = this.Visit(b.Expression);
262
return
Expression
.TypeIs(expr, b.TypeOperand);
273
internal virtual
Expression
VisitConstant(ConstantExpression c)
283
internal virtual
Expression
VisitConditional(ConditionalExpression c)
285
Expression
test = this.Visit(c.Test);
286
Expression
iftrue = this.Visit(c.IfTrue);
287
Expression
iffalse = this.Visit(c.IfFalse);
290
return
Expression
.Condition(test, iftrue, iffalse);
301
internal virtual
Expression
VisitParameter(ParameterExpression p)
311
internal virtual
Expression
VisitMemberAccess(MemberExpression m)
313
Expression
exp = this.Visit(m.Expression);
316
return
Expression
.MakeMemberAccess(exp, m.Member);
327
internal virtual
Expression
VisitMethodCall(MethodCallExpression m)
329
Expression
obj = this.Visit(m.Object);
330
IEnumerable<
Expression
> args = this.VisitExpressionList(m.Arguments);
333
return
Expression
.Call(obj, m.Method, args);
344
internal virtual ReadOnlyCollection<
Expression
> VisitExpressionList(ReadOnlyCollection<
Expression
> original)
346
List<
Expression
> list = null;
349
Expression
p = this.Visit(original[i]);
356
list = new List<
Expression
>(n);
368
return new ReadOnlyCollection<
Expression
>(list);
381
Expression
e = this.Visit(assignment.Expression);
384
return
Expression
.Bind(assignment.Member, e);
400
return
Expression
.MemberBind(binding.Member, bindings);
416
return
Expression
.ListBind(binding.Member, initializers);
497
internal virtual
Expression
VisitLambda(LambdaExpression lambda)
499
Expression
body = this.Visit(lambda.Body);
503
return
Expression
.Lambda(lambda.Type, body, lambda.Parameters);
521
IEnumerable<
Expression
> args = this.VisitExpressionList(nex.Arguments);
526
return
Expression
.New(nex.Constructor, args, nex.Members);
530
return
Expression
.New(nex.Constructor, args);
542
internal virtual
Expression
VisitMemberInit(MemberInitExpression init)
548
return
Expression
.MemberInit(n, bindings);
559
internal virtual
Expression
VisitListInit(ListInitExpression init)
565
return
Expression
.ListInit(n, initializers);
576
internal virtual
Expression
VisitNewArray(NewArrayExpression na)
578
IEnumerable<
Expression
> exprs = this.VisitExpressionList(na.Expressions);
583
return
Expression
.NewArrayInit(na.Type.GetElementType(), exprs);
587
return
Expression
.NewArrayBounds(na.Type.GetElementType(), exprs);
599
internal virtual
Expression
VisitInvocation(InvocationExpression iv)
601
IEnumerable<
Expression
> args = this.VisitExpressionList(iv.Arguments);
602
Expression
expr = this.Visit(iv.Expression);
605
return
Expression
.Invoke(expr, args);
System\Data\Services\Client\ALinq\DataServiceExpressionVisitor.cs (7)
30
internal override
Expression
Visit(
Expression
exp)
56
internal virtual
Expression
VisitResourceSetExpression(ResourceSetExpression rse)
58
Expression
source = this.Visit(rse.Source);
73
internal virtual
Expression
VisitNavigationPropertySingletonExpression(NavigationPropertySingletonExpression npse)
75
Expression
source = this.Visit(npse.Source);
92
internal virtual
Expression
VisitInputReferenceExpression(InputReferenceExpression ire)
System\Data\Services\Client\ALinq\DataServiceQueryProvider.cs (12)
46
public IQueryable CreateQuery(
Expression
expression)
56
new Type[] { typeof(
Expression
), typeof(DataServiceQueryProvider) },
66
public IQueryable<TElement> CreateQuery<TElement>(
Expression
expression)
77
public object Execute(
Expression
expression)
89
public TResult Execute<TResult>(
Expression
expression)
101
internal TElement ReturnSingleton<TElement>(
Expression
expression)
139
internal QueryComponents Translate(
Expression
e)
144
Dictionary<
Expression
,
Expression
> normalizerRewrites = null;
151
normalizerRewrites = new Dictionary<
Expression
,
Expression
>(ReferenceEqualityComparer<
Expression
>.Instance);
System\Data\Services\Client\ALinq\Evaluator.cs (27)
75
internal static
Expression
PartialEval(
Expression
expression, Func<
Expression
, bool> canBeEvaluated)
78
HashSet<
Expression
> candidates = nominator.Nominate(expression);
87
internal static
Expression
PartialEval(
Expression
expression)
97
private static bool CanBeEvaluatedLocally(
Expression
expression)
110
private HashSet<
Expression
> candidates;
116
internal SubtreeEvaluator(HashSet<
Expression
> candidates)
126
internal
Expression
Eval(
Expression
exp)
136
internal override
Expression
Visit(
Expression
exp)
156
private static
Expression
Evaluate(
Expression
e)
166
LambdaExpression lambda =
Expression
.Lambda(e);
170
Debug.Assert(!(constantValue is
Expression
), "!(constantValue is Expression)");
181
return
Expression
.Constant(constantValue, constantType);
192
private Func<
Expression
, bool> functionCanBeEvaluated;
195
private HashSet<
Expression
> candidates;
207
internal Nominator(Func<
Expression
, bool> functionCanBeEvaluated)
219
internal HashSet<
Expression
> Nominate(
Expression
expression)
221
this.candidates = new HashSet<
Expression
>(EqualityComparer<
Expression
>.Default);
233
internal override
Expression
Visit(
Expression
expression)
System\Data\Services\Client\ALinq\ExpressionNormalizer.cs (79)
55
private readonly Dictionary<
Expression
, Pattern> _patterns = new Dictionary<
Expression
, Pattern>(ReferenceEqualityComparer<
Expression
>.Instance);
58
private readonly Dictionary<
Expression
,
Expression
> normalizerRewrites;
66
private ExpressionNormalizer(Dictionary<
Expression
,
Expression
> normalizerRewrites)
77
internal Dictionary<
Expression
,
Expression
> NormalizerRewrites
92
internal static
Expression
Normalize(
Expression
expression, Dictionary<
Expression
,
Expression
> rewrites)
98
Expression
result = normalizer.Visit(expression);
108
internal override
Expression
VisitBinary(BinaryExpression b)
117
Expression
normalizedLeft = UnwrapObjectConvert(visited.Left);
118
Expression
normalizedRight = UnwrapObjectConvert(visited.Right);
153
internal override
Expression
VisitUnary(UnaryExpression u)
156
Expression
result = visited;
192
private static
Expression
UnwrapObjectConvert(
Expression
input)
203
return
Expression
.Constant(constant.Value, constant.Value.GetType());
219
private static bool IsConstantZero(
Expression
expression)
231
internal override
Expression
VisitMethodCall(MethodCallExpression call)
233
Expression
visited = this.VisitMethodCallNoRewrite(call);
244
internal
Expression
VisitMethodCallNoRewrite(MethodCallExpression call)
260
return
Expression
.Equal(visited.Arguments[0], visited.Arguments[1], LiftToNull, visited.Method);
263
return
Expression
.NotEqual(visited.Arguments[0], visited.Arguments[1], LiftToNull, visited.Method);
266
return
Expression
.GreaterThan(visited.Arguments[0], visited.Arguments[1], LiftToNull, visited.Method);
269
return
Expression
.GreaterThanOrEqual(visited.Arguments[0], visited.Arguments[1], LiftToNull, visited.Method);
272
return
Expression
.LessThan(visited.Arguments[0], visited.Arguments[1], LiftToNull, visited.Method);
275
return
Expression
.LessThanOrEqual(visited.Arguments[0], visited.Arguments[1], LiftToNull, visited.Method);
278
return
Expression
.Multiply(visited.Arguments[0], visited.Arguments[1], visited.Method);
281
return
Expression
.Subtract(visited.Arguments[0], visited.Arguments[1], visited.Method);
284
return
Expression
.Add(visited.Arguments[0], visited.Arguments[1], visited.Method);
287
return
Expression
.Divide(visited.Arguments[0], visited.Arguments[1], visited.Method);
290
return
Expression
.Modulo(visited.Arguments[0], visited.Arguments[1], visited.Method);
293
return
Expression
.And(visited.Arguments[0], visited.Arguments[1], visited.Method);
296
return
Expression
.Or(visited.Arguments[0], visited.Arguments[1], visited.Method);
299
return
Expression
.ExclusiveOr(visited.Arguments[0], visited.Arguments[1], visited.Method);
315
return
Expression
.Negate(visited.Arguments[0], visited.Method);
318
return
Expression
.UnaryPlus(visited.Arguments[0], visited.Method);
322
return
Expression
.Convert(visited.Arguments[0], visited.Type, visited.Method);
326
return
Expression
.Not(visited.Arguments[0], visited.Method);
340
return
Expression
.Equal(visited.Arguments[0], visited.Arguments[1], false, visited.Method);
395
Expression
normalizedArgument;
399
List<
Expression
> normalizedArguments = new List<
Expression
>(callExpression.Arguments);
404
result =
Expression
.Call(callExpression.Object, callExpression.Method, normalizedArguments);
466
private static bool TryMatchCoalescePattern(
Expression
expression, out
Expression
normalized)
478
normalized =
Expression
.Quote(normalized);
494
normalized =
Expression
.Lambda(lambda.Type,
Expression
.Convert(coalesce.Left, typeof(bool)), lambda.Parameters);
518
private static BinaryExpression CreateRelationalOperator(ExpressionType op,
Expression
left,
Expression
right)
533
private static bool TryCreateRelationalOperator(ExpressionType op,
Expression
left,
Expression
right, out BinaryExpression result)
540
result =
Expression
.Equal(left, right, LiftToNull, relationalOperatorPlaceholderMethod);
544
result =
Expression
.NotEqual(left, right, LiftToNull, relationalOperatorPlaceholderMethod);
548
result =
Expression
.LessThan(left, right, LiftToNull, relationalOperatorPlaceholderMethod);
552
result =
Expression
.LessThanOrEqual(left, right, LiftToNull, relationalOperatorPlaceholderMethod);
556
result =
Expression
.GreaterThan(left, right, LiftToNull, relationalOperatorPlaceholderMethod);
560
result =
Expression
.GreaterThanOrEqual(left, right, LiftToNull, relationalOperatorPlaceholderMethod);
579
private
Expression
CreateCompareExpression(
Expression
left,
Expression
right)
581
Expression
result =
Expression
.Condition(
583
Expression
.Constant(0),
584
Expression
.Condition(
586
Expression
.Constant(1),
587
Expression
.Constant(-1)));
605
private void RecordRewrite(
Expression
source,
Expression
rewritten)
643
internal ComparePattern(
Expression
left,
Expression
right)
652
internal readonly
Expression
Left;
657
internal readonly
Expression
Right;
System\Data\Services\Client\ALinq\ExpressionWriter.cs (25)
40
private readonly Stack<
Expression
> expressionStack;
46
private
Expression
parent;
59
this.expressionStack = new Stack<
Expression
>();
69
internal static string ExpressionToString(DataServiceContext context,
Expression
e)
84
internal override
Expression
Visit(
Expression
exp)
88
Expression
result = base.Visit(exp);
98
internal override
Expression
VisitConditional(ConditionalExpression c)
109
internal override
Expression
VisitLambda(LambdaExpression lambda)
131
internal override
Expression
VisitMemberInit(MemberInitExpression init)
142
internal override
Expression
VisitListInit(ListInitExpression init)
153
internal override
Expression
VisitNewArray(NewArrayExpression na)
164
internal override
Expression
VisitInvocation(InvocationExpression iv)
175
internal override
Expression
VisitInputReferenceExpression(InputReferenceExpression ire)
197
internal override
Expression
VisitMethodCall(MethodCallExpression m)
257
internal override
Expression
VisitMemberAccess(MemberExpression m)
264
Expression
e = this.Visit(m.Expression);
288
internal override
Expression
VisitConstant(ConstantExpression c)
311
internal override
Expression
VisitUnary(UnaryExpression u)
368
internal override
Expression
VisitBinary(BinaryExpression b)
439
internal override
Expression
VisitTypeIs(TypeBinaryExpression b)
464
internal override
Expression
VisitParameter(ParameterExpression p)
474
private static bool IsInputReference(
Expression
exp)
509
private void VisitOperand(
Expression
e)
528
private string Translate(
Expression
e)
System\Data\Services\Client\ALinq\FilterQueryOptionExpression.cs (3)
23
private
Expression
predicate;
30
internal FilterQueryOptionExpression(Type type,
Expression
predicate)
37
internal
Expression
Predicate
System\Data\Services\Client\ALinq\InputBinder.cs (9)
78
internal static
Expression
Bind(
Expression
e, ResourceExpression currentInput, ParameterExpression inputParameter, List<ResourceExpression> referencedInputs)
86
Expression
result = binder.Visit(e);
102
internal override
Expression
VisitMemberAccess(MemberExpression m)
163
Expression
source;
195
Expression
result = this.CreateReference(target);
198
result =
Expression
.Property(result, nestedAccesses.Pop());
214
internal override
Expression
VisitParameter(ParameterExpression p)
237
private
Expression
CreateReference(ResourceExpression resource)
System\Data\Services\Client\ALinq\NavigationPropertySingletonExpression.cs (3)
29
private readonly
Expression
memberExpression;
47
internal NavigationPropertySingletonExpression(Type type,
Expression
source,
Expression
memberExpression, Type resourceType, List<string> expandPaths, CountOption countOption, Dictionary<ConstantExpression, ConstantExpression> customQueryOptions, ProjectionQueryOptionExpression projection)
System\Data\Services\Client\ALinq\OrderByQueryOptionExpression.cs (2)
55
internal readonly
Expression
Expression;
67
internal Selector(
Expression
e, bool descending)
System\Data\Services\Client\ALinq\ProjectionAnalyzer.cs (35)
69
Expression
withoutConverts = SkipConverts(le.Body);
151
internal static bool IsCollectionProducingExpression(
Expression
e)
175
internal static bool IsDisallowedExpressionForMethodCall(
Expression
e)
237
private static
Expression
SkipConverts(
Expression
expression)
239
Expression
result = expression;
312
Expression
[] lastExpressions = analysis.GetExpressionsBeyondTargetEntity();
343
internal override
Expression
VisitUnary(UnaryExpression u)
369
internal override
Expression
VisitBinary(BinaryExpression b)
374
internal override
Expression
VisitTypeIs(TypeBinaryExpression b)
379
internal override
Expression
VisitConditional(ConditionalExpression c)
391
internal override
Expression
VisitConstant(ConstantExpression c)
396
internal override
Expression
VisitMemberAccess(MemberExpression m)
409
Expression
e = base.VisitMemberAccess(m);
417
internal override
Expression
VisitMethodCall(MethodCallExpression m)
437
internal override
Expression
VisitInvocation(InvocationExpression iv)
442
internal override
Expression
VisitLambda(LambdaExpression lambda)
448
internal override
Expression
VisitListInit(ListInitExpression init)
453
internal override
Expression
VisitNewArray(NewArrayExpression na)
458
internal override
Expression
VisitMemberInit(MemberInitExpression init)
474
foreach (
Expression
e in nex.Arguments)
490
internal override
Expression
VisitParameter(ParameterExpression p)
532
internal static void Analyze(
Expression
e, PathBox pb)
558
internal override
Expression
VisitUnary(UnaryExpression u)
573
internal override
Expression
VisitBinary(BinaryExpression b)
584
internal override
Expression
VisitTypeIs(TypeBinaryExpression b)
594
internal override
Expression
VisitConditional(ConditionalExpression c)
624
internal override
Expression
VisitMemberAccess(MemberExpression m)
643
Expression
e = base.VisitMemberAccess(m);
651
internal override
Expression
VisitMethodCall(MethodCallExpression m)
676
internal override
Expression
VisitInvocation(InvocationExpression iv)
687
internal override
Expression
VisitLambda(LambdaExpression lambda)
693
internal override
Expression
VisitMemberInit(MemberInitExpression init)
711
internal override
Expression
VisitParameter(ParameterExpression p)
722
internal override
Expression
VisitConstant(ConstantExpression c)
System\Data\Services\Client\ALinq\ProjectionRewriter.cs (4)
39
this.newLambdaParameter =
Expression
.Parameter(proposedParameterType, "it");
67
Expression
body = this.Visit(lambda.Body);
74
return
Expression
.Lambda(delegateType, body, new ParameterExpression[] { this.newLambdaParameter });
83
internal override
Expression
VisitMemberAccess(MemberExpression m)
System\Data\Services\Client\ALinq\QueryComponents.cs (6)
34
private readonly Dictionary<
Expression
,
Expression
> normalizerRewrites;
52
internal QueryComponents(Uri uri, Version version, Type lastSegmentType, LambdaExpression projection, Dictionary<
Expression
,
Expression
> normalizerRewrites)
73
internal Dictionary<
Expression
,
Expression
> NormalizerRewrites
System\Data\Services\Client\ALinq\ResourceBinder.cs (154)
27
/// This class provides a Bind method that analyzes an input <see cref="
Expression
"/> and returns a bound tree.
37
internal static
Expression
Bind(
Expression
e)
42
Expression
boundExpression = rb.Visit(e);
58
internal static bool IsMissingKeyPredicates(
Expression
expression)
85
internal static void VerifyKeyPredicates(
Expression
e)
95
internal static void VerifyNotSelectManyProjection(
Expression
expression)
127
private static
Expression
AnalyzePredicate(MethodCallExpression mce)
156
List<
Expression
> conjuncts = new List<
Expression
>();
159
Dictionary<ResourceSetExpression, List<
Expression
>> predicatesByTarget = new Dictionary<ResourceSetExpression, List<
Expression
>>(ReferenceEqualityComparer<ResourceSetExpression>.Instance);
161
foreach (
Expression
e in conjuncts)
163
Expression
reboundPredicate = InputBinder.Bind(e, input, le.Parameters[0], referencedInputs);
177
List<
Expression
> targetPredicates = null;
180
targetPredicates = new List<
Expression
>();
189
List<
Expression
> inputPredicates;
199
foreach (KeyValuePair<ResourceSetExpression, List<
Expression
>> predicates in predicatesByTarget)
202
List<
Expression
> clauses = predicates.Value;
227
Expression
predicateFilter = BuildKeyPredicateFilter(input.CreateReference(), inputKeyValues);
245
Expression
predicateFilter = BuildKeyPredicateFilter(input.CreateReference(), input.KeyPredicate);
251
Expression
newFilter;
265
newFilter =
Expression
.And(newFilter, inputPredicates[idx]);
353
List<
Expression
> predicates,
360
List<
Expression
> nonKeyPredicates = null;
362
foreach (
Expression
predicate in predicates)
385
nonKeyPredicates = new List<
Expression
>();
420
private static
Expression
BuildKeyPredicateFilter(InputReferenceExpression input, Dictionary<PropertyInfo, ConstantExpression> keyValuesDictionary)
426
Expression
retExpr = null;
429
Expression
clause =
Expression
.Equal(
Expression
.Property(input, keyValue.Key), keyValue.Value);
436
retExpr =
Expression
.And(retExpr, clause);
446
private static void AddConjuncts(
Expression
e, List<
Expression
> conjuncts)
469
internal bool AnalyzeProjection(MethodCallExpression mce, SequenceMethod sequenceMethod, out
Expression
e)
494
Expression
collectionSelector = mce.Arguments[1];
500
Expression
resultSelector = mce.Arguments[2];
517
Expression
collectorReference = InputBinder.Bind(collectionLambda.Body, source, collectionLambda.Parameters[0], referencedExpressions);
538
resultLambda =
Expression
.Lambda(resultLambda.Body, new ParameterExpression[] { resultLambda.Parameters[1] });
598
internal static
Expression
AnalyzeNavigation(MethodCallExpression mce)
601
Expression
input = mce.Arguments[0];
604
Expression
boundProjection;
630
private static bool IsValidNavigationSource(
Expression
input, out ResourceExpression sourceExpression)
648
internal static
Expression
AnalyzeSelectMany(MethodCallExpression mce)
670
Expression
navPropRef = InputBinder.Bind(collectorSelector.Body, input, collectorSelector.Parameters[0], referencedInputs);
708
private static
Expression
AnalyzeSelectManySelector(MethodCallExpression selectManyCall, ResourceSetExpression sourceResourceSet)
715
Expression
result;
732
selector =
Expression
.Lambda(selector.Body, new ParameterExpression[] { selector.Parameters[1] });
751
internal static
Expression
ApplyOrdering(MethodCallExpression mce, ResourceSetExpression input,
Expression
selector, bool descending, bool thenBy)
779
private static
Expression
LimitCardinality(MethodCallExpression mce, int maxCardinality)
798
AddSequenceQueryOption(rse, new TakeQueryOptionExpression(mce.Type,
Expression
.Constant(maxCardinality)));
814
private static
Expression
AnalyzeCast(MethodCallExpression mce)
825
private static
Expression
StripConvert(
Expression
e)
849
private static
Expression
AnalyzeExpand(MethodCallExpression mce)
851
Expression
obj = StripConvert(mce.Object);
869
private static
Expression
AnalyzeAddCustomQueryOption(MethodCallExpression mce)
871
Expression
obj = StripConvert(mce.Object);
899
private static
Expression
AnalyzeAddCountOption(MethodCallExpression mce, CountOption countOption)
901
Expression
obj = StripConvert(mce.Object);
924
private static ResourceSetExpression CreateResourceSetExpression(Type type, ResourceExpression source,
Expression
memberExpression, Type resourceType)
946
private static NavigationPropertySingletonExpression CreateNavigationPropertySingletonExpression(Type type, ResourceExpression source,
Expression
memberExpression)
962
/// <param name="expectedResultType">The result type - <see cref="
Expression
.Type"/> - that the new resource set expression should have.</param>
988
internal static
Expression
StripConvertToAssignable(
Expression
e)
992
Expression
result;
1014
internal static T StripTo<T>(
Expression
expression) where T :
Expression
1018
Expression
result;
1030
internal override
Expression
VisitResourceSetExpression(ResourceSetExpression rse)
1062
private static bool TryBindToInput(ResourceExpression input, LambdaExpression le, out
Expression
bound)
1074
private static
Expression
AnalyzeResourceSetMethod(MethodCallExpression mce, Func<MethodCallExpression, ResourceSetExpression,
Expression
,
Expression
> sequenceMethodAnalyzer)
1084
Expression
lambdaBody;
1094
private static
Expression
AnalyzeResourceSetConstantMethod(MethodCallExpression mce, Func<MethodCallExpression, ResourceExpression, ConstantExpression,
Expression
> constantMethodAnalyzer)
1107
private static
Expression
AnalyzeCountMethod(MethodCallExpression mce)
1173
internal override
Expression
VisitBinary(BinaryExpression b)
1175
Expression
e = base.VisitBinary(b);
1180
return
Expression
.Call(mi, new
Expression
[] {be.Left, be.Right});
1186
internal override
Expression
VisitMemberAccess(MemberExpression m)
1188
Expression
e = base.VisitMemberAccess(m);
1196
return
Expression
.Call(me.Expression, mi);
1202
internal override
Expression
VisitMethodCall(MethodCallExpression mce)
1204
Expression
e;
1239
Expression
result = AnalyzeSelectMany(mce);
1308
private static
Expression
StripCastMethodCalls(
Expression
expression)
1371
internal static bool MatchParameterMemberAccess(
Expression
expression)
1382
Expression
body = StripCastMethodCalls(lambda.Body);
1406
internal static bool MatchPropertyAccess(
Expression
e, out MemberExpression member, out
Expression
instance, out List<string> propertyPath)
1443
internal static bool MatchConstant(
Expression
e, out ConstantExpression constExpr)
1449
internal static bool MatchAnd(
Expression
e)
1455
internal static bool MatchNonPrivateReadableProperty(
Expression
e, out PropertyInfo propInfo)
1499
internal static bool MatchKeyProperty(
Expression
expression, out PropertyInfo property)
1538
internal static bool MatchKeyComparison(
Expression
e, out PropertyInfo keyProperty, out ConstantExpression keyValue)
1562
internal static bool MatchReferenceEquals(
Expression
expression)
1580
internal static bool MatchResource(
Expression
expression, out ResourceExpression resource)
1593
internal static bool MatchDoubleArgumentLambda(
Expression
expression, out LambdaExpression lambda)
1619
internal static bool MatchSingleArgumentLambda(
Expression
expression, out LambdaExpression lambda)
1631
internal static bool MatchTransparentIdentitySelector(
Expression
input, LambdaExpression selector)
1644
Expression
potentialRef = selector.Body;
1648
Expression
paramRef;
1659
internal static bool MatchIdentityProjectionResultSelector(
Expression
e)
1745
Dictionary<string,
Expression
> sourceAccessors = new Dictionary<string,
Expression
>(constructorParams.Length - 1, StringComparer.Ordinal);
1748
Expression
argument = ne.Arguments[i];
1791
Expression
boundArgument = InputBinder.Bind(argument, inputSourceSet, resultSelector.Parameters[0], referencedInputs);
1824
internal static bool MatchPropertyProjectionSet(ResourceExpression input,
Expression
potentialPropertyRef, out MemberExpression navigationMember)
1840
internal static bool MatchPropertyProjectionSingleton(ResourceExpression input,
Expression
potentialPropertyRef, out MemberExpression navigationMember)
1857
private static bool MatchNavigationPropertyProjection(ResourceExpression input,
Expression
potentialPropertyRef, bool requireSet, out MemberExpression navigationMember)
1861
Expression
foundInstance;
1876
internal static bool MatchMemberInitExpressionWithDefaultConstructor(
Expression
source, LambdaExpression e)
1883
internal static bool MatchNewExpression(
Expression
source, LambdaExpression e)
1895
internal static bool MatchNot(
Expression
expression)
1904
internal static bool MatchNonSingletonProperty(
Expression
e)
1920
internal static MatchNullCheckResult MatchNullCheck(
Expression
entityInScope, ConditionalExpression conditional)
1931
Expression
assignedCandidate;
1954
Expression
memberCandidate;
1984
Expression
[] assignedExpressions = assignedAnalysis.GetExpressionsToTargetEntity();
1985
Expression
[] memberExpressions = memberAnalysis.GetExpressionsToTargetEntity();
1994
Expression
assigned = assignedExpressions[i];
1995
Expression
member = memberExpressions[i];
2021
internal static bool MatchNullConstant(
Expression
expression)
2033
internal static bool MatchBinaryExpression(
Expression
e)
2038
internal static bool MatchBinaryEquality(
Expression
e)
2043
internal static bool MatchStringAddition(
Expression
e)
2081
internal static MatchEqualityCheckResult MatchEquality(
Expression
expression)
2146
private static bool ExpressionIsSimpleAccess(
Expression
argument, ReadOnlyCollection<ParameterExpression> expressions)
2151
Expression
source = argument;
2180
private static bool MatchNaryLambda(
Expression
expression, int parameterCount, out LambdaExpression lambda)
2200
internal
Expression
AssignExpression;
2206
internal
Expression
TestToNullExpression;
2222
internal
Expression
TestLeft;
2225
internal
Expression
TestRight;
2231
internal static void RequireCanNavigate(
Expression
e)
2246
internal static void RequireCanProject(
Expression
e)
2265
internal static void RequireCanExpand(
Expression
e)
2279
internal static void RequireCanAddCount(
Expression
e)
2294
internal static void RequireCanAddCustomQueryOption(
Expression
e)
2303
internal static void RequireNonSingleton(
Expression
e)
2312
internal static void RequireLegalCustomQueryOption(
Expression
e, ResourceExpression target)
2432
private readonly
Expression
target;
2444
private ExpressionPresenceVisitor(
Expression
target)
2457
internal static bool IsExpressionPresent(
Expression
target,
Expression
tree)
2470
internal override
Expression
Visit(
Expression
exp)
2472
Expression
result;
System\Data\Services\Client\ALinq\ResourceExpression.cs (3)
45
protected readonly
Expression
source;
72
internal ResourceExpression(
Expression
source, ExpressionType nodeType, Type type, List<string> expandPaths, CountOption countOption, Dictionary<ConstantExpression, ConstantExpression> customQueryOptions, ProjectionQueryOptionExpression projection)
140
internal
Expression
Source
System\Data\Services\Client\ALinq\ResourceSetExpression.cs (6)
38
private readonly
Expression
member;
61
internal ResourceSetExpression(Type type,
Expression
source,
Expression
memberExpression, Type resourceType, List<string> expandPaths, CountOption countOption, Dictionary<ConstantExpression, ConstantExpression> customQueryOptions, ProjectionQueryOptionExpression projection)
82
internal
Expression
MemberExpression
304
internal readonly Dictionary<string,
Expression
> SourceAccessors;
313
internal TransparentAccessors(string acc, Dictionary<string,
Expression
> sourceAccesors)
System\Data\Services\Client\ALinq\SkipQueryOptionExpression.cs (1)
66
return new SkipQueryOptionExpression(this.Type,
Expression
.Constant(thisValue + previousValue, typeof(int)));
System\Data\Services\Client\ALinq\UriWriter.cs (19)
63
internal static void Translate(DataServiceContext context, bool addTrailingParens,
Expression
e, out Uri uri, out Version version)
77
internal override
Expression
VisitMethodCall(MethodCallExpression m)
87
internal override
Expression
VisitUnary(UnaryExpression u)
97
internal override
Expression
VisitBinary(BinaryExpression b)
107
internal override
Expression
VisitConstant(ConstantExpression c)
117
internal override
Expression
VisitTypeIs(TypeBinaryExpression b)
127
internal override
Expression
VisitConditional(ConditionalExpression c)
137
internal override
Expression
VisitParameter(ParameterExpression p)
147
internal override
Expression
VisitMemberAccess(MemberExpression m)
157
internal override
Expression
VisitLambda(LambdaExpression lambda)
177
internal override
Expression
VisitMemberInit(MemberInitExpression init)
187
internal override
Expression
VisitListInit(ListInitExpression init)
197
internal override
Expression
VisitNewArray(NewArrayExpression na)
207
internal override
Expression
VisitInvocation(InvocationExpression iv)
217
internal override
Expression
VisitNavigationPropertySingletonExpression(NavigationPropertySingletonExpression npse)
230
internal override
Expression
VisitResourceSetExpression(ResourceSetExpression rse)
309
Expression
e = ((
Expression
)options.Current);
544
private string ExpressionToString(
Expression
expression)
System\Data\Services\Client\AtomMaterializer.cs (7)
1116
ParameterExpression list =
Expression
.Parameter(typeof(object), "list");
1117
ParameterExpression item =
Expression
.Parameter(typeof(object), "element");
1118
Expression
body =
Expression
.Call(
Expression
.Convert(list, listType), addMethod,
Expression
.Convert(item, listElementType));
1122
LambdaExpression lambda =
Expression
.Lambda(body, list, item);
System\Data\Services\Client\DataServiceContext.cs (1)
584
ResourceSetExpression rse = new ResourceSetExpression(typeof(IOrderedQueryable<T>), null,
Expression
.Constant(entitySetName), typeof(T), null, CountOption.None, null, null);
System\Data\Services\Client\DataServiceQuery.cs (1)
27
public abstract
Expression
Expression
System\Data\Services\Client\DataServiceQueryOfT.cs (15)
36
private readonly
Expression
queryExpression;
51
private DataServiceQuery(
Expression
expression, DataServiceQueryProvider provider)
73
public override
Expression
Expression
160
Expression
.Call(
161
Expression
.Convert(this.Expression, typeof(DataServiceQuery<TElement>.DataServiceOrderedQuery)),
163
new
Expression
[] {
Expression
.Constant(path) }));
175
Expression
.Call(
176
Expression
.Convert(this.Expression, typeof(DataServiceQuery<TElement>.DataServiceOrderedQuery)),
192
Expression
.Call(
193
Expression
.Convert(this.Expression, typeof(DataServiceQuery<TElement>.DataServiceOrderedQuery)),
195
new
Expression
[] {
Expression
.Constant(name),
Expression
.Constant(value, typeof(object)) }));
300
internal DataServiceOrderedQuery(
Expression
expression, DataServiceQueryProvider provider)
System\Data\Services\Client\MemberAssignmentAnalysis.cs (32)
39
internal static readonly
Expression
[] EmptyExpressionArray = new
Expression
[0];
42
private readonly
Expression
entity;
51
private List<
Expression
> pathFromEntity;
59
private MemberAssignmentAnalysis(
Expression
entity)
64
this.pathFromEntity = new List<
Expression
>();
91
internal static MemberAssignmentAnalysis Analyze(
Expression
entityInScope,
Expression
assignmentExpression)
120
Expression
[] previousExpressions = previous.GetExpressionsToTargetEntity();
121
Expression
[] candidateExpressions = this.GetExpressionsToTargetEntity();
129
internal override
Expression
Visit(
Expression
expression)
148
internal override
Expression
VisitConditional(ConditionalExpression c)
150
Expression
result;
169
internal override
Expression
VisitParameter(ParameterExpression p)
189
internal override
Expression
VisitMemberInit(MemberInitExpression init)
191
Expression
result = init;
228
internal override
Expression
VisitMemberAccess(MemberExpression m)
230
Expression
result = base.VisitMemberAccess(m);
242
internal override
Expression
VisitMethodCall(MethodCallExpression call)
258
internal
Expression
[] GetExpressionsBeyondTargetEntity()
267
Expression
[] result = new
Expression
[1];
274
internal
Expression
[] GetExpressionsToTargetEntity()
283
Expression
[] result = new
Expression
[this.pathFromEntity.Count - 1];
300
private static Exception CheckCompatibleAssignments(Type targetType,
Expression
[] previous,
Expression
[] candidate)
313
Expression
p = previous[i];
314
Expression
c = candidate[i];
344
private static Exception CheckCompatibleAssignmentsFail(Type targetType,
Expression
[] previous,
Expression
[] candidate)
System\Data\Services\Client\ProjectionPath.cs (8)
37
internal ProjectionPath(ParameterExpression root,
Expression
expectedRootType,
Expression
rootEntry)
50
internal ProjectionPath(ParameterExpression root,
Expression
expectedRootType,
Expression
rootEntry, IEnumerable<
Expression
> members)
55
foreach (
Expression
member in members)
73
internal
Expression
RootEntry
80
internal
Expression
ExpectedRootType
System\Data\Services\Client\ProjectionPathBuilder.cs (17)
43
private readonly Stack<
Expression
> parameterExpressionTypes;
46
private readonly Stack<
Expression
> parameterEntries;
61
this.parameterExpressionTypes = new Stack<
Expression
>();
62
this.parameterEntries = new Stack<
Expression
>();
77
internal
Expression
ExpectedParamTypeInScope
93
internal
Expression
LambdaParameterInScope
102
internal
Expression
ParameterEntryInScope
137
internal void EnterLambdaScope(LambdaExpression lambda,
Expression
entry,
Expression
expectedType)
167
internal
Expression
GetRewrite(
Expression
expression)
179
Expression
result = null;
235
internal void RegisterRewrite(
Expression
root, string[] names,
Expression
rewriteExpression)
248
internal void RevokeRewrite(
Expression
root, string[] names)
298
internal
Expression
Root
305
internal
Expression
RewriteExpression
System\Data\Services\Client\ProjectionPlanCompiler.cs (140)
35
private readonly Dictionary<
Expression
, ExpressionAnnotation> annotations;
41
private readonly Dictionary<
Expression
,
Expression
> normalizerRewrites;
60
private ProjectionPlanCompiler(Dictionary<
Expression
,
Expression
> normalizerRewrites)
62
this.annotations = new Dictionary<
Expression
, ExpressionAnnotation>(ReferenceEqualityComparer<
Expression
>.Instance);
63
this.materializerExpression =
Expression
.Parameter(typeof(object), "mat");
76
internal static ProjectionPlan CompilePlan(LambdaExpression projection, Dictionary<
Expression
,
Expression
> normalizerRewrites)
94
Expression
plan = rewriter.Visit(projection);
116
internal override
Expression
VisitBinary(BinaryExpression b)
118
Expression
original = this.GetExpressionBeforeNormalization(b);
136
internal override
Expression
VisitConditional(ConditionalExpression conditional)
139
Expression
original = this.GetExpressionBeforeNormalization(conditional);
161
internal override
Expression
VisitUnary(UnaryExpression u)
163
Expression
original = this.GetExpressionBeforeNormalization(u);
164
Expression
result;
191
internal override
Expression
VisitMemberAccess(MemberExpression m)
195
Expression
result;
196
Expression
baseSourceExpression = m.Expression;
205
Expression
baseTargetExpression = this.Visit(baseSourceExpression);
213
result =
Expression
.MakeMemberAccess(baseTargetExpression, m.Member);
228
internal override
Expression
VisitParameter(ParameterExpression p)
233
Expression
result;
256
internal override
Expression
VisitMemberInit(MemberInitExpression init)
260
Expression
result = null;
277
internal override
Expression
VisitMethodCall(MethodCallExpression m)
281
Expression
original = this.GetExpressionBeforeNormalization(m);
287
Expression
result;
342
internal override
Expression
VisitLambda(LambdaExpression lambda)
346
Expression
result;
351
ParameterExpression expectedTypeParameter =
Expression
.Parameter(typeof(Type), "type" + this.identifierId);
352
ParameterExpression entryParameter =
Expression
.Parameter(typeof(object), "entry" + this.identifierId);
361
Expression
body = this.Visit(lambda.Body);
368
body =
Expression
.Convert(body, typeof(object));
371
result =
Expression
.Lambda<Func<object, object, Type, object>>(
399
private static
Expression
CallMaterializer(string methodName, params
Expression
[] arguments)
413
private static
Expression
CallMaterializerWithType(string methodName, Type[] typeArguments, params
Expression
[] arguments)
425
return
Expression
.Call(method, arguments);
433
private
Expression
CallCheckValueForPathIsNull(
Expression
entry,
Expression
entryType, ProjectionPath path)
435
Expression
result = CallMaterializer("ProjectionCheckValueForPathIsNull", entry, entryType,
Expression
.Constant(path, typeof(object)));
445
private
Expression
CallValueForPath(
Expression
entry,
Expression
entryType, ProjectionPath path)
450
Expression
result = CallMaterializer("ProjectionValueForPath", this.materializerExpression, entry, entryType,
Expression
.Constant(path, typeof(object)));
461
private
Expression
CallValueForPathWithType(
Expression
entry,
Expression
entryType, ProjectionPath path, Type type)
466
Expression
value = this.CallValueForPath(entry, entryType, path);
467
Expression
result =
Expression
.Convert(value, type);
484
private
Expression
RebindConditionalNullCheck(ConditionalExpression conditional, ResourceBinder.PatternRules.MatchNullCheckResult nullCheck)
489
Expression
testToNullForProjection = this.Visit(nullCheck.TestToNullExpression);
490
Expression
assignForProjection = this.Visit(nullCheck.AssignExpression);
499
Expression
testToNullThroughMethod = this.CallCheckValueForPathIsNull(
504
Expression
test = testToNullThroughMethod;
505
Expression
iftrue =
Expression
.Constant(null, assignForProjection.Type);
506
Expression
iffalse = assignForProjection;
507
Expression
result =
Expression
.Condition(test, iftrue, iffalse);
518
private
Expression
RebindEntityMemberInit(MemberInitExpression init)
524
Expression
[] expressions;
538
Expression
entryParameterAtMemberInit = this.pathBuilder.ParameterEntryInScope;
542
Expression
projectedTypeExpression =
Expression
.Constant(projectedType, typeof(Type));
551
Expression
entryToInitValue; // Expression that yields value for entry in target tree.
552
Expression
expectedParamValue; // Expression that yield expectedType in target tree.
567
entryParameterForMembers =
Expression
.Parameter(typeof(object), "subentry" + this.identifierId++);
600
Expression
nestedEntry = CallMaterializer(
603
Expression
.Constant(assignment.Member.Name, typeof(string)));
604
ParameterExpression nestedEntryParameter =
Expression
.Parameter(
639
Expression
e = this.Visit(assignment.Expression);
643
e =
Expression
.Convert(e, typeof(object));
651
propertyLambda =
Expression
.Lambda(e, parameters);
653
Expression
[] nestedParams =
654
new
Expression
[]
667
propertyLambda =
Expression
.Lambda(
Expression
.Invoke(propertyLambda, nestedParams), invokeParameters);
672
Expression
e = this.Visit(assignment.Expression);
673
e =
Expression
.Convert(e, typeof(object));
681
propertyLambda =
Expression
.Lambda(e, parameters);
698
Expression
reboundExpression = CallMaterializer(
704
Expression
.Constant(propertyNames.ToArray()),
705
Expression
.Constant(propertyFunctions.ToArray()));
707
return
Expression
.Convert(reboundExpression, projectedType);
716
private
Expression
GetDeepestEntry(
Expression
[] path)
720
Expression
result = null;
727
Expression
.Constant(((MemberExpression)path[pathIndex]).Member.Name, typeof(string)));
738
private
Expression
GetExpressionBeforeNormalization(
Expression
expression)
743
Expression
original;
757
private
Expression
RebindParameter(
Expression
expression, ExpressionAnnotation annotation)
762
Expression
result;
786
private
Expression
RebindMemberAccess(MemberExpression m, ExpressionAnnotation baseAnnotation)
796
Expression
baseSourceExpression = m.Expression;
797
Expression
result = this.pathBuilder.GetRewrite(baseSourceExpression);
800
Expression
baseTypeExpression =
Expression
.Constant(baseSourceExpression.Type, typeof(Type));
857
result =
Expression
.New(
860
Expression
.Constant(null, typeof(DataServiceContext)),
862
Expression
.Constant(TrackingMode.AutoChangeTracking, typeof(TrackingMode)),
863
Expression
.Constant(null, typeof(string)),
864
Expression
.Constant(null, typeof(Func<EntityChangedParams, bool>)),
865
Expression
.Constant(null, typeof(Func<EntityCollectionChangedParams, bool>)));
875
result =
Expression
.New(
878
Expression
.Constant(null, typeof(DataServiceContext)),
881
Expression
.Constant(null, typeof(string)),
882
Expression
.Constant(null, typeof(Func<EntityChangedParams, bool>)),
883
Expression
.Constant(null, typeof(Func<EntityCollectionChangedParams, bool>)));
897
result =
Expression
.New(
900
Expression
.Constant(null, typeof(DataServiceContext)),
921
result =
Expression
.New(
949
private
Expression
RebindMethodCallForMemberSelect(MethodCallExpression call)
957
Expression
result = null;
958
Expression
parameterSource = this.Visit(call.Arguments[0]);
975
Expression
selectorExpression = this.Visit(call.Arguments[1]);
982
Expression
.Constant(returnElementType, typeof(Type)),
983
Expression
.Constant(annotation.Segment.StartPath, typeof(object)),
1010
private
Expression
RebindMethodCallForMemberToList(MethodCallExpression call)
1019
Expression
result = this.Visit(call.Arguments[0]);
1033
private
Expression
RebindMethodCallForNewSequence(MethodCallExpression call)
1044
Expression
result = null;
1051
Expression
parameterSource = this.Visit(call.Arguments[0]);
1064
Expression
selectorExpression = this.Visit(call.Arguments[1]);
1071
Expression
.Constant(returnElementType, typeof(Type)),
1072
Expression
.Constant(annotation.Segment.StartPath, typeof(object)),
1087
Expression
source = this.Visit(call.Arguments[0]);
1108
private
Expression
TypedEnumerableToList(
Expression
source, Type targetType)
1119
Expression
result = CallMaterializerWithType(
System.IdentityModel (2)
System\IdentityModel\CryptoHelper.cs (2)
1283
System.Linq.Expressions.NewExpression algorithmCreationExpression = System.Linq.Expressions.
Expression
.New(algorithmType);
1284
System.Linq.Expressions.LambdaExpression creationFunction = System.Linq.Expressions.
Expression
.Lambda<Func<object>>(algorithmCreationExpression);
System.Web (13)
UI\WebControls\QueryExtensions.cs (7)
34
ParameterExpression parameter =
Expression
.Parameter(source.ElementType, String.Empty);
40
property =
Expression
.Property(parameter, sortExpressionField);
43
property =
Expression
.Property(property, sortExpressionField);
46
LambdaExpression lambda =
Expression
.Lambda(property, parameter);
50
Expression
methodCallExpression =
Expression
.Call(typeof(Queryable), methodName,
52
source.Expression,
Expression
.Quote(lambda));
Util\OrderingMethodFinder.cs (3)
13
protected override
Expression
VisitMethodCall(MethodCallExpression node) {
19
Expression
result = base.VisitMethodCall(node);
24
internal static bool OrderMethodExists(
Expression
expression) {
Util\QueryableUtility.cs (3)
10
private static MethodInfo GetQueryableMethod(
Expression
expression) {
20
public static bool IsQueryableMethod(
Expression
expression, string method) {
24
public static bool IsOrderingMethod(
Expression
expression) {
System.Web.DynamicData (26)
DynamicData\DynamicDataExtensions.cs (3)
274
tableParameter =
Expression
.Parameter(rowType, "e");
276
var memberExpression =
Expression
.Property(tableParameter, member.Name);
277
loadOptions.LoadWith(
Expression
.Lambda(memberExpression, tableParameter));
DynamicData\MetaTable.cs (2)
730
Expression
ofTypeExpression =
Expression
.Call(typeof(Queryable), "OfType", new[] { EntityType }, query.Expression);
DynamicData\QueryableFilterUserControl.cs (14)
133
private static
Expression
CreatePropertyExpression(
Expression
parameterExpression, string propertyName) {
134
Expression
propExpression = null;
138
propExpression =
Expression
.PropertyOrField(parameterExpression, p);
141
propExpression =
Expression
.PropertyOrField(propExpression, p);
148
ParameterExpression parameterExpression =
Expression
.Parameter(source.ElementType, String.Empty);
149
Expression
propertyExpression = CreatePropertyExpression(parameterExpression, propertyName);
151
propertyExpression =
Expression
.Convert(propertyExpression, Misc.RemoveNullableFromType(propertyExpression.Type));
154
Expression
compareExpression =
Expression
.Equal(propertyExpression,
Expression
.Constant(value));
155
LambdaExpression lambda =
Expression
.Lambda(compareExpression, parameterExpression);
156
MethodCallExpression whereCall =
Expression
.Call(typeof(Queryable), "Where", new Type[] { source.ElementType }, source.Expression,
Expression
.Quote(lambda));
DynamicData\Util\Misc.cs (7)
237
var parameter =
Expression
.Parameter(query.ElementType, "row");
243
lambda =
Expression
.Lambda(
Expression
.Property(
Expression
.Property(parameter, sortColumn.Name), foreignKeySortColumn.Name), parameter);
247
lambda =
Expression
.Lambda(
Expression
.Property(parameter, sortColumn.Name), parameter);
250
var expression =
Expression
.Call(typeof(Queryable), ordering, new Type[] { query.ElementType, lambda.Body.Type }, query.Expression, lambda);
System.Web.Entity (7)
System\Data\WebControls\OrderByBuilder.cs (7)
178
var
expression = source.Expression;
179
var parameter =
Expression
.Parameter(source.ElementType, String.Empty);
192
Expression
memberExpression = parameter;
199
memberExpression =
Expression
.Property(memberExpression, memberElement.Trim());
202
expression =
Expression
.Call(typeof(Queryable), methodName, new Type[] { source.ElementType, memberExpression.Type },
203
new
Expression
[] { expression,
Expression
.Quote(DynamicExpression.Lambda(memberExpression, parameter)) });
System.Web.Extensions (275)
UI\WebControls\Dynamic.cs (207)
34
Expression
.Call(
37
source.Expression,
Expression
.Quote(lambda)));
45
Expression
.Call(
48
source.Expression,
Expression
.Quote(lambda)));
59
Expression
.Parameter(source.ElementType, "") };
62
Expression
queryExpr = source.Expression;
66
queryExpr =
Expression
.Call(
69
queryExpr,
Expression
.Quote(DynamicExpression.Lambda(o.Selector, parameters)));
79
Expression
.Call(
82
source.Expression,
Expression
.Constant(count)));
88
Expression
.Call(
91
source.Expression,
Expression
.Constant(count)));
101
Expression
.Call(
104
source.Expression,
Expression
.Quote(keyLambda),
Expression
.Quote(elementLambda)));
110
Expression
.Call(
118
Expression
.Call(
172
public static
Expression
Parse(Type resultType, string expression, params object[] values) {
178
return ParseLambda(new ParameterExpression[] {
Expression
.Parameter(itType, "") }, resultType, expression, values);
198
public static LambdaExpression Lambda(
Expression
body, params ParameterExpression[] parameters) {
203
return
Expression
.Lambda(GetFuncType(typeArgs), body, parameters);
215
public
Expression
Selector;
622
static readonly
Expression
trueLiteral =
Expression
.Constant(true);
623
static readonly
Expression
falseLiteral =
Expression
.Constant(false);
624
static readonly
Expression
nullLiteral =
Expression
.Constant(null);
634
Dictionary<
Expression
, string> literals;
646
literals = new Dictionary<
Expression
, string>();
681
public
Expression
Parse(Type resultType) {
683
Expression
expr = ParseExpression();
695
Expression
expr = ParseExpression();
714
Expression
ParseExpression() {
716
Expression
expr = ParseLogicalOr();
719
Expression
expr1 = ParseExpression();
722
Expression
expr2 = ParseExpression();
729
Expression
ParseLogicalOr() {
730
Expression
left = ParseLogicalAnd();
734
Expression
right = ParseLogicalAnd();
736
left =
Expression
.OrElse(left, right);
742
Expression
ParseLogicalAnd() {
743
Expression
left = ParseComparison();
747
Expression
right = ParseComparison();
749
left =
Expression
.AndAlso(left, right);
755
Expression
ParseComparison() {
756
Expression
left = ParseAdditive();
763
Expression
right = ParseAdditive();
769
right =
Expression
.Convert(right, left.Type);
772
left =
Expression
.Convert(left, right.Type);
781
Expression
e;
824
Expression
ParseAdditive() {
825
Expression
left = ParseMultiplicative();
830
Expression
right = ParseMultiplicative();
851
Expression
ParseMultiplicative() {
852
Expression
left = ParseUnary();
857
Expression
right = ParseUnary();
861
left =
Expression
.Multiply(left, right);
864
left =
Expression
.Divide(left, right);
868
left =
Expression
.Modulo(left, right);
876
Expression
ParseUnary() {
887
Expression
expr = ParseUnary();
890
expr =
Expression
.Negate(expr);
894
expr =
Expression
.Not(expr);
901
Expression
ParsePrimary() {
902
Expression
expr = ParsePrimaryStart();
918
Expression
ParsePrimaryStart() {
935
Expression
ParseStringLiteral() {
956
Expression
ParseIntegerLiteral() {
980
Expression
ParseRealLiteral() {
998
Expression
CreateLiteral(object value, string text) {
999
ConstantExpression expr =
Expression
.Constant(value);
1005
Expression
ParseParenExpression() {
1008
Expression
e = ParseExpression();
1014
Expression
ParseIdentifier() {
1023
return (
Expression
)value;
1027
Expression
expr = value as
Expression
;
1029
expr =
Expression
.Constant(value);
1042
Expression
ParseIt() {
1049
Expression
ParseIif() {
1052
Expression
[] args = ParseArgumentList();
1058
Expression
GenerateConditional(
Expression
test,
Expression
expr1,
Expression
expr2, int errorPos) {
1062
Expression
expr1as2 = expr2 != nullLiteral ? PromoteExpression(expr1, expr2.Type, true) : null;
1063
Expression
expr2as1 = expr1 != nullLiteral ? PromoteExpression(expr2, expr1.Type, true) : null;
1078
return
Expression
.Condition(test, expr1, expr2);
1081
Expression
ParseNew() {
1086
List<
Expression
> expressions = new List<
Expression
>();
1089
Expression
expr = ParseExpression();
1111
bindings[i] =
Expression
.Bind(type.GetProperty(properties[i].Name), expressions[i]);
1112
return
Expression
.MemberInit(
Expression
.New(type), bindings);
1115
Expression
ParseLambdaInvocation(LambdaExpression lambda) {
1118
Expression
[] args = ParseArgumentList();
1122
return
Expression
.Invoke(lambda, args);
1125
Expression
ParseTypeAccess(Type type) {
1135
Expression
[] args = ParseArgumentList();
1143
return
Expression
.New((ConstructorInfo)method, args);
1153
Expression
GenerateConversion(
Expression
expr, Type type, int errorPos) {
1159
return
Expression
.Convert(expr, type);
1162
return
Expression
.ConvertChecked(expr, type);
1166
return
Expression
.Convert(expr, type);
1171
Expression
ParseMemberAccess(Type type,
Expression
instance) {
1184
Expression
[] args = ParseArgumentList();
1197
return
Expression
.Call(instance, (MethodInfo)method, args);
1209
Expression
.Property(instance, (PropertyInfo)member) :
1210
Expression
.Field(instance, (FieldInfo)member);
1228
Expression
ParseAggregate(
Expression
instance, Type elementType, string methodName, int errorPos) {
1230
ParameterExpression innerIt =
Expression
.Parameter(elementType, "");
1232
Expression
[] args = ParseArgumentList();
1245
args = new
Expression
[] { instance };
1248
args = new
Expression
[] { instance, DynamicExpression.Lambda(args[0], innerIt) };
1250
return
Expression
.Call(typeof(Enumerable), signature.Name, typeArgs, args);
1253
Expression
[] ParseArgumentList() {
1256
Expression
[] args = token.id != TokenId.CloseParen ? ParseArguments() : new
Expression
[0];
1262
Expression
[] ParseArguments() {
1263
List<
Expression
> argList = new List<
Expression
>();
1272
Expression
ParseElementAccess(
Expression
expr) {
1276
Expression
[] args = ParseArguments();
1282
Expression
index = PromoteExpression(args[0], typeof(int), true);
1286
return
Expression
.ArrayIndex(expr, index);
1296
return
Expression
.Call(expr, (MethodInfo)mb, args);
1364
void CheckAndPromoteOperand(Type signatures, string opName, ref
Expression
expr, int errorPos) {
1365
Expression
[] args = new
Expression
[] { expr };
1373
void CheckAndPromoteOperands(Type signatures, string opName, ref
Expression
left, ref
Expression
right, int errorPos) {
1374
Expression
[] args = new
Expression
[] { left, right };
1382
Exception IncompatibleOperandsError(string opName,
Expression
left,
Expression
right, int pos) {
1398
int FindMethod(Type type, string methodName, bool staticAccess,
Expression
[] args, out MethodBase method) {
1411
int FindIndexer(Type type,
Expression
[] args, out MethodBase method) {
1454
public
Expression
[] Args;
1457
int FindBestMethod(IEnumerable<MethodBase> methods,
Expression
[] args, out MethodBase method) {
1478
bool IsApplicable(MethodData method,
Expression
[] args) {
1480
Expression
[] promotedArgs = new
Expression
[args.Length];
1484
Expression
promoted = PromoteExpression(args[i], pi.ParameterType, false);
1492
Expression
PromoteExpression(
Expression
expr, Type type, bool exact) {
1498
return
Expression
.Constant(null, type);
1520
return
Expression
.Constant(value, type);
1525
if (type.IsValueType || exact) return
Expression
.Convert(expr, type);
1704
static bool IsBetterThan(
Expression
[] args, MethodData m1, MethodData m2) {
1732
Expression
GenerateEqual(
Expression
left,
Expression
right) {
1733
return
Expression
.Equal(left, right);
1736
Expression
GenerateNotEqual(
Expression
left,
Expression
right) {
1737
return
Expression
.NotEqual(left, right);
1740
Expression
GenerateGreaterThan(
Expression
left,
Expression
right) {
1742
return
Expression
.GreaterThan(
1744
Expression
.Constant(0)
1747
return
Expression
.GreaterThan(left, right);
1750
Expression
GenerateGreaterThanEqual(
Expression
left,
Expression
right) {
1752
return
Expression
.GreaterThanOrEqual(
1754
Expression
.Constant(0)
1757
return
Expression
.GreaterThanOrEqual(left, right);
1760
Expression
GenerateLessThan(
Expression
left,
Expression
right) {
1762
return
Expression
.LessThan(
1764
Expression
.Constant(0)
1767
return
Expression
.LessThan(left, right);
1770
Expression
GenerateLessThanEqual(
Expression
left,
Expression
right) {
1772
return
Expression
.LessThanOrEqual(
1774
Expression
.Constant(0)
1777
return
Expression
.LessThanOrEqual(left, right);
1780
Expression
GenerateAdd(
Expression
left,
Expression
right) {
1784
return
Expression
.Add(left, right);
1787
Expression
GenerateSubtract(
Expression
left,
Expression
right) {
1788
return
Expression
.Subtract(left, right);
1791
Expression
GenerateStringConcat(
Expression
left,
Expression
right) {
1792
if (left.Type.IsValueType) left =
Expression
.Convert(left, typeof(object));
1793
if (right.Type.IsValueType) right =
Expression
.Convert(right, typeof(object));
1794
return
Expression
.Call(
1800
MethodInfo GetStaticMethod(string methodName,
Expression
left,
Expression
right) {
1804
Expression
GenerateStaticMethodCall(string methodName,
Expression
left,
Expression
right) {
1805
return
Expression
.Call(null, GetStaticMethod(methodName, left, right), new[] { left, right });
UI\WebControls\Expressions\ExpressionHelper.cs (22)
8
public static
Expression
GetValue(
Expression
exp) {
13
return
Expression
.Convert(exp, realType);
28
public static
Expression
CreatePropertyExpression(
Expression
parameterExpression, string propertyName) {
37
Expression
propExpression = null;
41
propExpression =
Expression
.PropertyOrField(parameterExpression, p);
44
propExpression =
Expression
.PropertyOrField(propExpression, p);
55
public static IQueryable Call(this IQueryable source, string queryMethod, Type[] genericArgs, params
Expression
[] arguments) {
60
Expression
.Call(
71
Expression
.Call(
74
source.Expression,
Expression
.Quote(lambda)));
77
public static
Expression
Or(IEnumerable<
Expression
> expressions) {
78
Expression
orExpression = null;
79
foreach (
Expression
e in expressions) {
87
orExpression =
Expression
.OrElse(orExpression, e);
93
public static
Expression
And(IEnumerable<
Expression
> expressions) {
94
Expression
andExpression = null;
95
foreach (
Expression
e in expressions) {
103
andExpression =
Expression
.AndAlso(andExpression, e);
UI\WebControls\Expressions\OfTypeExpression.cs (1)
79
return query.Provider.CreateQuery(
Expression
.Call(null, OfTypeMethod, query.Expression));
UI\WebControls\Expressions\OrderByExpression.cs (3)
61
ParameterExpression pe =
Expression
.Parameter(source.ElementType, String.Empty);
73
Expression
propertyExpression = ExpressionHelper.CreatePropertyExpression(parameterExpression, dataField);
76
Expression
.Lambda(propertyExpression, parameterExpression),
UI\WebControls\Expressions\PropertyExpression.cs (10)
16
List<
Expression
> equalsExpressions = new List<
Expression
>();
17
ParameterExpression parameterExpression =
Expression
.Parameter(source.ElementType, String.Empty);
22
Expression
property = ExpressionHelper.CreatePropertyExpression(parameterExpression, pair.Key);
27
Expression
valueExpression =
Expression
.Constant(value, property.Type);
28
Expression
equalsExpression =
Expression
.Equal(property, valueExpression);
35
Expression
body = ExpressionHelper.And(equalsExpressions);
36
return ExpressionHelper.Where(source,
Expression
.Lambda(body, parameterExpression));
UI\WebControls\Expressions\RangeExpression.cs (20)
58
ParameterExpression parameterExpression =
Expression
.Parameter(source.ElementType, String.Empty);
59
Expression
properyExpression = ExpressionHelper.GetValue(ExpressionHelper.CreatePropertyExpression(parameterExpression, DataField));
65
Expression
minExpression = null;
66
Expression
maxExpression = null;
93
Expression
rangeExpression = CreateRangeExpressionBody(minExpression, maxExpression);
95
return ExpressionHelper.Where(source,
Expression
.Lambda(rangeExpression, parameterExpression));
98
private static
Expression
GetMinRangeExpression(
Expression
propertyExpression, object value, RangeType rangeType) {
99
ConstantExpression constantValue =
Expression
.Constant(ExpressionHelper.BuildObjectValue(value, propertyExpression.Type));
102
return
Expression
.GreaterThan(propertyExpression, constantValue);
106
return
Expression
.GreaterThanOrEqual(propertyExpression, constantValue);
113
private static
Expression
GetMaxRangeExpression(
Expression
propertyExpression, object value, RangeType rangeType) {
114
ConstantExpression constantValue =
Expression
.Constant(ExpressionHelper.BuildObjectValue(value, propertyExpression.Type));
117
return
Expression
.LessThan(propertyExpression, constantValue);
121
return
Expression
.LessThanOrEqual(propertyExpression, constantValue);
128
private static
Expression
CreateRangeExpressionBody(
Expression
minExpression,
Expression
maxExpression) {
141
return
Expression
.AndAlso(minExpression, maxExpression);
UI\WebControls\Expressions\SearchExpression.cs (12)
66
List<
Expression
> searchExpressions = new List<
Expression
>();
68
ParameterExpression parameterExpression =
Expression
.Parameter(source.ElementType, String.Empty);
71
Expression
property = ExpressionHelper.CreatePropertyExpression(parameterExpression, p.Trim());
76
Expression
.Lambda(ExpressionHelper.Or(searchExpressions),
80
private
Expression
CreateCallExpression(
Expression
property, string query) {
84
return
Expression
.Call(property, SearchType.ToString(), Type.EmptyTypes,
Expression
.Constant(query, property.Type));
86
return
Expression
.Call(property, SearchType.ToString(), Type.EmptyTypes,
Expression
.Constant(query, property.Type),
Expression
.Constant(ComparisonType));