2 types derived from ParameterExpression
System.Linq.Expressions (2)
1 instantiation of ParameterExpression
System.Linq.Expressions (1)
828 references to ParameterExpression
Microsoft.AspNetCore.Components.Endpoints (62)
FormMapping\Factories\ComplexType\ComplexTypeExpressionConverterFactoryOfT.cs (62)
33var parameters = new List<ParameterExpression>() { readerParam, typeParam, optionsParam, resultParam, foundValueParam };
36var propertyFoundValue = Expression.Variable(typeof(bool), "foundValueForProperty");
37var succeeded = Expression.Variable(typeof(bool), "succeeded");
38var localFoundValueVar = Expression.Variable(typeof(bool), "localFoundValue");
39var exceptionVar = Expression.Variable(typeof(Exception), "mappingException");
40var variables = new List<ParameterExpression>() { propertyFoundValue, succeeded, localFoundValueVar, exceptionVar };
42var propertyValueLocals = new List<ParameterExpression>();
43var constructorParameterValueLocals = new List<ParameterExpression>();
110ParameterExpression resultParam,
112List<ParameterExpression> constructorParameterValueLocals,
114List<ParameterExpression> propsLocals,
115List<ParameterExpression> variables,
116ParameterExpression succeeded,
117ParameterExpression context)
145var exception = Expression.Variable(typeof(Exception), "constructorException");
214static BinaryExpression HasHandler(ParameterExpression context)
226List<ParameterExpression> constructorParameters,
228List<ParameterExpression> properties,
230ParameterExpression succeeded)
234var parameter = constructorParameters[i];
259var property = properties[i];
323ParameterExpression readerParam,
324ParameterExpression optionsParam,
325ParameterExpression propertyFoundValue,
326ParameterExpression succeeded,
327ParameterExpression localFoundValueVar,
328ParameterExpression exceptionVar,
329List<ParameterExpression> variables,
330List<ParameterExpression> propertyValueLocals,
344var propertyConverterVar = Expression.Variable(propertyConverterType, $"{property.Name}Converter");
422ParameterExpression readerParam,
423ParameterExpression optionsParam,
424ParameterExpression propertyFoundValue,
425ParameterExpression succeeded,
426ParameterExpression localFoundValueVar,
427ParameterExpression exceptionVar,
428List<ParameterExpression> variables,
429List<ParameterExpression> constructorParameterValueLocals,
444var constructorParameterConverterVar = Expression.Variable(constructorParameterConverterType, $"{constructorParameter.Name}Converter");
523private static Expression GetValueLocalVariableFoundExpression(ParameterExpression constructorParameterVar)
530private static Expression GetValueLocalVariableValueExpression(ParameterExpression constructorParameterVar) =>
535private static ParameterExpression CreateValueLocalVariable(IFormDataValue constructorParameter)
549private static ConditionalExpression CreatePrefixCheckForRecursiveTypes(ParameterExpression readerParam, ParameterExpression foundValueParam, ParameterExpression succeeded, LabelTarget end)
560List<ParameterExpression> parameters,
561List<ParameterExpression> variables,
583public ParameterExpression ReaderParam { get; }
585public ParameterExpression TypeParam { get; }
587public ParameterExpression OptionsParam { get; }
589public ParameterExpression ResultParam { get; }
591public ParameterExpression FoundValueParam { get; }
594ParameterExpression readerParam,
595ParameterExpression typeParam,
596ParameterExpression optionsParam,
597ParameterExpression resultParam,
598ParameterExpression foundValueParam)
608out ParameterExpression readerParam,
609out ParameterExpression typeParam,
610out ParameterExpression optionsParam,
611out ParameterExpression resultParam,
612out ParameterExpression foundValueParam)
Microsoft.AspNetCore.Components.Forms (2)
Microsoft.AspNetCore.Components.QuickGrid (2)
Microsoft.AspNetCore.Components.Web (1)
Microsoft.AspNetCore.Http.Abstractions (4)
Microsoft.AspNetCore.Http.Extensions (104)
RequestDelegateFactory.cs (20)
85private static readonly ParameterExpression TargetExpr = Expression.Parameter(typeof(object), "target");
86private static readonly ParameterExpression BodyValueExpr = Expression.Parameter(typeof(object), "bodyValue");
87private static readonly ParameterExpression WasParamCheckFailureExpr = Expression.Variable(typeof(bool), "wasParamCheckFailure");
88private static readonly ParameterExpression BoundValuesArrayExpr = Expression.Parameter(typeof(object[]), "boundValues");
90private static readonly ParameterExpression HttpContextExpr = ParameterBindingMethodCache.SharedExpressions.HttpContextExpr;
106private static readonly ParameterExpression TempSourceStringExpr = ParameterBindingMethodCache.SharedExpressions.TempSourceStringExpr;
114private static readonly ParameterExpression FilterContextExpr = Expression.Parameter(typeof(EndpointFilterInvocationContext), "context");
119private static readonly ParameterExpression InvokedFilterContextExpr = Expression.Parameter(typeof(EndpointFilterInvocationContext), "filterContext");
972var localVariables = new ParameterExpression[factoryContext.ExtraLocals.Count + 1];
1570var argumentExpression = Expression.Variable(parameter.ParameterType, $"{parameter.Name}_local");
1668var argument = Expression.Variable(parameter.ParameterType, $"{parameter.Name}_local");
1752var parsedValue = Expression.Variable(nonNullableParameterType, "parsedValue");
1781var index = Expression.Variable(typeof(int), "index");
1798var stringArrayExpr = parameter.ParameterType.IsArray ? Expression.Variable(typeof(string[]), "tempStringArray") : null;
1895var argument = Expression.Variable(parameter.ParameterType, $"{parameter.Name}_local");
2112var formArgument = Expression.Variable(parameter.ParameterType, $"{parameter.Name}_local");
2133var formReader = Expression.Variable(typeof(FormDataReader), $"{parameter.Name}_reader");
2134var formDict = Expression.Variable(typeof(IReadOnlyDictionary<FormKey, StringValues>), "form_dict");
2135var formBuffer = Expression.Variable(typeof(char[]), "form_buffer");
2136var formDataMappingException = Expression.Variable(typeof(FormDataMappingException), "form_exception");
src\Components\Endpoints\src\FormMapping\Factories\ComplexType\ComplexTypeExpressionConverterFactoryOfT.cs (62)
33var parameters = new List<ParameterExpression>() { readerParam, typeParam, optionsParam, resultParam, foundValueParam };
36var propertyFoundValue = Expression.Variable(typeof(bool), "foundValueForProperty");
37var succeeded = Expression.Variable(typeof(bool), "succeeded");
38var localFoundValueVar = Expression.Variable(typeof(bool), "localFoundValue");
39var exceptionVar = Expression.Variable(typeof(Exception), "mappingException");
40var variables = new List<ParameterExpression>() { propertyFoundValue, succeeded, localFoundValueVar, exceptionVar };
42var propertyValueLocals = new List<ParameterExpression>();
43var constructorParameterValueLocals = new List<ParameterExpression>();
110ParameterExpression resultParam,
112List<ParameterExpression> constructorParameterValueLocals,
114List<ParameterExpression> propsLocals,
115List<ParameterExpression> variables,
116ParameterExpression succeeded,
117ParameterExpression context)
145var exception = Expression.Variable(typeof(Exception), "constructorException");
214static BinaryExpression HasHandler(ParameterExpression context)
226List<ParameterExpression> constructorParameters,
228List<ParameterExpression> properties,
230ParameterExpression succeeded)
234var parameter = constructorParameters[i];
259var property = properties[i];
323ParameterExpression readerParam,
324ParameterExpression optionsParam,
325ParameterExpression propertyFoundValue,
326ParameterExpression succeeded,
327ParameterExpression localFoundValueVar,
328ParameterExpression exceptionVar,
329List<ParameterExpression> variables,
330List<ParameterExpression> propertyValueLocals,
344var propertyConverterVar = Expression.Variable(propertyConverterType, $"{property.Name}Converter");
422ParameterExpression readerParam,
423ParameterExpression optionsParam,
424ParameterExpression propertyFoundValue,
425ParameterExpression succeeded,
426ParameterExpression localFoundValueVar,
427ParameterExpression exceptionVar,
428List<ParameterExpression> variables,
429List<ParameterExpression> constructorParameterValueLocals,
444var constructorParameterConverterVar = Expression.Variable(constructorParameterConverterType, $"{constructorParameter.Name}Converter");
523private static Expression GetValueLocalVariableFoundExpression(ParameterExpression constructorParameterVar)
530private static Expression GetValueLocalVariableValueExpression(ParameterExpression constructorParameterVar) =>
535private static ParameterExpression CreateValueLocalVariable(IFormDataValue constructorParameter)
549private static ConditionalExpression CreatePrefixCheckForRecursiveTypes(ParameterExpression readerParam, ParameterExpression foundValueParam, ParameterExpression succeeded, LabelTarget end)
560List<ParameterExpression> parameters,
561List<ParameterExpression> variables,
583public ParameterExpression ReaderParam { get; }
585public ParameterExpression TypeParam { get; }
587public ParameterExpression OptionsParam { get; }
589public ParameterExpression ResultParam { get; }
591public ParameterExpression FoundValueParam { get; }
594ParameterExpression readerParam,
595ParameterExpression typeParam,
596ParameterExpression optionsParam,
597ParameterExpression resultParam,
598ParameterExpression foundValueParam)
608out ParameterExpression readerParam,
609out ParameterExpression typeParam,
610out ParameterExpression optionsParam,
611out ParameterExpression resultParam,
612out ParameterExpression foundValueParam)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (11)
200var targetParameter = Expression.Parameter(typeof(object), "target");
201var parametersParameter = Expression.Parameter(typeof(object?[]), "parameters");
252var targetParameter = Expression.Parameter(typeof(object), "target");
253var parametersParameter = Expression.Parameter(typeof(object[]), "parameters");
279var customAwaitableParam = Expression.Parameter(typeof(object), "awaitable");
292var isCompletedParam = Expression.Parameter(typeof(object), "awaiter");
299var getResultParam = Expression.Parameter(typeof(object), "awaiter");
333var onCompletedParam1 = Expression.Parameter(typeof(object), "awaiter");
334var onCompletedParam2 = Expression.Parameter(typeof(Action), "continuation");
349var unsafeOnCompletedParam1 = Expression.Parameter(typeof(object), "awaiter");
350var unsafeOnCompletedParam2 = Expression.Parameter(typeof(Action), "continuation");
src\Shared\ParameterBindingMethodCache.cs (7)
38internal static readonly ParameterExpression TempSourceStringExpr = Expression.Variable(typeof(string), "tempSourceString");
39internal static readonly ParameterExpression HttpContextExpr = Expression.Parameter(typeof(HttpContext), "httpContext");
46private readonly ConcurrentDictionary<Type, Func<ParameterExpression, Expression, Expression>?> _stringMethodCallCache = new();
80public Func<ParameterExpression, Expression, Expression>? FindTryParseMethod(Type type)
85Func<ParameterExpression, Expression, Expression>? Finder(Type type)
105var enumAsObject = Expression.Variable(typeof(object), "enumAsObject");
106var success = Expression.Variable(typeof(bool), "success");
Microsoft.AspNetCore.Http.Extensions.Tests (4)
Microsoft.AspNetCore.JsonPatch (1)
Microsoft.AspNetCore.Mvc.Abstractions (8)
src\Shared\ParameterBindingMethodCache.cs (7)
38internal static readonly ParameterExpression TempSourceStringExpr = Expression.Variable(typeof(string), "tempSourceString");
39internal static readonly ParameterExpression HttpContextExpr = Expression.Parameter(typeof(HttpContext), "httpContext");
46private readonly ConcurrentDictionary<Type, Func<ParameterExpression, Expression, Expression>?> _stringMethodCallCache = new();
80public Func<ParameterExpression, Expression, Expression>? FindTryParseMethod(Type type)
85Func<ParameterExpression, Expression, Expression>? Finder(Type type)
105var enumAsObject = Expression.Variable(typeof(object), "enumAsObject");
106var success = Expression.Variable(typeof(bool), "success");
Microsoft.AspNetCore.Mvc.Core (20)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (11)
200var targetParameter = Expression.Parameter(typeof(object), "target");
201var parametersParameter = Expression.Parameter(typeof(object?[]), "parameters");
252var targetParameter = Expression.Parameter(typeof(object), "target");
253var parametersParameter = Expression.Parameter(typeof(object[]), "parameters");
279var customAwaitableParam = Expression.Parameter(typeof(object), "awaitable");
292var isCompletedParam = Expression.Parameter(typeof(object), "awaiter");
299var getResultParam = Expression.Parameter(typeof(object), "awaiter");
333var onCompletedParam1 = Expression.Parameter(typeof(object), "awaiter");
334var onCompletedParam2 = Expression.Parameter(typeof(Action), "continuation");
349var unsafeOnCompletedParam1 = Expression.Parameter(typeof(object), "awaiter");
350var unsafeOnCompletedParam2 = Expression.Parameter(typeof(Action), "continuation");
Microsoft.AspNetCore.Mvc.RazorPages (10)
Microsoft.AspNetCore.Mvc.ViewFeatures (5)
Microsoft.AspNetCore.OpenApi (21)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (11)
200var targetParameter = Expression.Parameter(typeof(object), "target");
201var parametersParameter = Expression.Parameter(typeof(object?[]), "parameters");
252var targetParameter = Expression.Parameter(typeof(object), "target");
253var parametersParameter = Expression.Parameter(typeof(object[]), "parameters");
279var customAwaitableParam = Expression.Parameter(typeof(object), "awaitable");
292var isCompletedParam = Expression.Parameter(typeof(object), "awaiter");
299var getResultParam = Expression.Parameter(typeof(object), "awaiter");
333var onCompletedParam1 = Expression.Parameter(typeof(object), "awaiter");
334var onCompletedParam2 = Expression.Parameter(typeof(Action), "continuation");
349var unsafeOnCompletedParam1 = Expression.Parameter(typeof(object), "awaiter");
350var unsafeOnCompletedParam2 = Expression.Parameter(typeof(Action), "continuation");
src\Shared\ParameterBindingMethodCache.cs (7)
38internal static readonly ParameterExpression TempSourceStringExpr = Expression.Variable(typeof(string), "tempSourceString");
39internal static readonly ParameterExpression HttpContextExpr = Expression.Parameter(typeof(HttpContext), "httpContext");
46private readonly ConcurrentDictionary<Type, Func<ParameterExpression, Expression, Expression>?> _stringMethodCallCache = new();
80public Func<ParameterExpression, Expression, Expression>? FindTryParseMethod(Type type)
85Func<ParameterExpression, Expression, Expression>? Finder(Type type)
105var enumAsObject = Expression.Variable(typeof(object), "enumAsObject");
106var success = Expression.Variable(typeof(bool), "success");
Microsoft.AspNetCore.OpenApi.Tests (1)
Microsoft.AspNetCore.Shared.Tests (14)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (11)
200var targetParameter = Expression.Parameter(typeof(object), "target");
201var parametersParameter = Expression.Parameter(typeof(object?[]), "parameters");
252var targetParameter = Expression.Parameter(typeof(object), "target");
253var parametersParameter = Expression.Parameter(typeof(object[]), "parameters");
279var customAwaitableParam = Expression.Parameter(typeof(object), "awaitable");
292var isCompletedParam = Expression.Parameter(typeof(object), "awaiter");
299var getResultParam = Expression.Parameter(typeof(object), "awaiter");
333var onCompletedParam1 = Expression.Parameter(typeof(object), "awaiter");
334var onCompletedParam2 = Expression.Parameter(typeof(Action), "continuation");
349var unsafeOnCompletedParam1 = Expression.Parameter(typeof(object), "awaiter");
350var unsafeOnCompletedParam2 = Expression.Parameter(typeof(Action), "continuation");
Microsoft.AspNetCore.SignalR.Core (14)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (11)
200var targetParameter = Expression.Parameter(typeof(object), "target");
201var parametersParameter = Expression.Parameter(typeof(object?[]), "parameters");
252var targetParameter = Expression.Parameter(typeof(object), "target");
253var parametersParameter = Expression.Parameter(typeof(object[]), "parameters");
279var customAwaitableParam = Expression.Parameter(typeof(object), "awaitable");
292var isCompletedParam = Expression.Parameter(typeof(object), "awaiter");
299var getResultParam = Expression.Parameter(typeof(object), "awaiter");
333var onCompletedParam1 = Expression.Parameter(typeof(object), "awaiter");
334var onCompletedParam2 = Expression.Parameter(typeof(Action), "continuation");
349var unsafeOnCompletedParam1 = Expression.Parameter(typeof(object), "awaiter");
350var unsafeOnCompletedParam2 = Expression.Parameter(typeof(Action), "continuation");
Microsoft.CodeAnalysis.EditorFeatures.Wpf (11)
Lightup\LightupHelpers.cs (11)
86var parameter = Expression.Parameter(typeof(T), GenerateParameterName(typeof(T)));
138var parameter = Expression.Parameter(typeof(T), GenerateParameterName(typeof(T)));
205var parameter = Expression.Parameter(typeof(T), GenerateParameterName(typeof(T)));
206var argument = Expression.Parameter(typeof(TArg), parameters[0].Name);
270var parameter = Expression.Parameter(typeof(T), GenerateParameterName(typeof(T)));
322var parameter = Expression.Parameter(typeof(T), GenerateParameterName(typeof(T)));
387var parameter = Expression.Parameter(typeof(T), GenerateParameterName(typeof(T)));
388var argument = Expression.Parameter(typeof(TArg), parameters[0].Name);
472var parameter = Expression.Parameter(typeof(T), GenerateParameterName(typeof(T)));
473var argument0 = Expression.Parameter(typeof(TArg0), parameters[0].Name);
474var argument1 = Expression.Parameter(typeof(TArg1), parameters[1].Name);
Microsoft.CodeAnalysis.LanguageServer.Protocol (4)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (1)
Microsoft.CSharp (7)
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (11)
HelperFactory.cs (11)
128var outputParameter = Expression.Parameter(typeof(TextWriter), "output");
129var optionsParameter = Expression.Parameter(typeof(HelperOptions), "options");
130var contextParameter = Expression.Parameter(typeof(object), "context");
131var argumentsParameter = Expression.Parameter(typeof(object[]), "arguments");
175var outputParameter = Expression.Parameter(typeof(TextWriter), "output");
176var contextParameter = Expression.Parameter(typeof(object), "context");
177var argumentsParameter = Expression.Parameter(typeof(object[]), "arguments");
247private static IEnumerable<Expression> GetParameterExpressions(MethodInfo method, ParameterExpression argumentsParameter, List<ProvidedParameter> providedParameters)
308ParameterExpression argumentsParameter)
320private static Expression GetExpressionForParamArrayParameter(Type parameterType, int index, ParameterExpression argumentsParameter)
329var selectParam = Expression.Parameter(typeof(object), "o");
Microsoft.Extensions.DependencyInjection (10)
Microsoft.Extensions.DependencyInjection.Abstractions (6)
ActivatorUtilities.cs (6)
292CreateFactoryInternal(instanceType, argumentTypes, out ParameterExpression provider, out ParameterExpression argumentArray, out Expression factoryExpressionBody);
325CreateFactoryInternal(typeof(T), argumentTypes, out ParameterExpression provider, out ParameterExpression argumentArray, out Expression factoryExpressionBody);
334private static void CreateFactoryInternal([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type instanceType, Type[] argumentTypes, out ParameterExpression provider, out ParameterExpression argumentArray, out Expression factoryExpressionBody)
Microsoft.ML.Core (6)
Microsoft.VisualBasic.Core (20)
Microsoft\VisualBasic\CompilerServices\IDOBinder.vb (18)
322Dim result As ParameterExpression = Expression.Variable(GetType(Object), "result")
323Dim array As ParameterExpression = Expression.Variable(GetType(Object()), "array")
340New ParameterExpression() {result, array},
401Dim result As ParameterExpression = Expression.Variable(GetType(Object), "result")
402Dim array As ParameterExpression = Expression.Variable(GetType(Object()), "array")
418New ParameterExpression() {result, array},
489Dim result As ParameterExpression = Expression.Variable(GetType(Object), "result")
490Dim array As ParameterExpression = Expression.Variable(GetType(Object()), "array")
505New ParameterExpression() {result, array},
558Dim result As ParameterExpression = Expression.Variable(GetType(Object), "result")
559Dim array As ParameterExpression = Expression.Variable(GetType(Object()), "array")
574New ParameterExpression() {result, array},
627Dim result As ParameterExpression = Expression.Variable(GetType(Object), "result")
628Dim array As ParameterExpression = Expression.Variable(GetType(Object()), "array")
643New ParameterExpression() {result, array},
1306Public Shared Function GetWriteBack(ByVal arguments() As Expression, ByVal array As ParameterExpression) As Expression
1309Dim arg As ParameterExpression = TryCast(arguments(i), ParameterExpression)
netstandard (1)
System.ComponentModel.Composition (9)
System\ComponentModel\Composition\ConstraintServices.cs (9)
25ParameterExpression parameter = Expression.Parameter(typeof(ExportDefinition), "exportDefinition");
56private static BinaryExpression CreateContractConstraintBody(string contractName, ParameterExpression parameter)
66private static Expression? CreateMetadataConstraintBody(IEnumerable<KeyValuePair<string, Type>> requiredMetadata, ParameterExpression parameter)
84private static BinaryExpression CreateCreationPolicyConstraint(CreationPolicy policy, ParameterExpression parameter)
104private static BinaryExpression CreateTypeIdentityConstraint(string requiredTypeIdentity, ParameterExpression parameter)
117private static MethodCallExpression CreateMetadataContainsKeyExpression(ParameterExpression parameter, string constantKey)
136private static MethodCallExpression CreateMetadataOfTypeExpression(ParameterExpression parameter, string constantKey, Type constantType)
164private static MethodCallExpression CreateMetadataValueEqualsExpression(ParameterExpression parameter, object constantValue, string metadataName)
188ParameterExpression exportDefinitionParameter = baseConstraint.Parameters[0];
System.Composition.Hosting (3)
System.Composition.TypedParts (7)
System.Core (1)
System.Linq.Expressions (453)
System\Dynamic\DynamicObject.cs (10)
463ParameterExpression? variable = args[i] as ParameterExpression;
570ParameterExpression result = Expression.Parameter(typeof(object), null);
571ParameterExpression callArgs = method != DynamicObject_TryBinaryOperation ? Expression.Parameter(typeof(object[]), null) : Expression.Parameter(typeof(object), null);
647new TrueReadOnlyCollection<ParameterExpression>(result, callArgs),
701ParameterExpression result = Expression.Parameter(typeof(object), null);
702ParameterExpression callArgs = Expression.Parameter(typeof(object[]), null);
707new TrueReadOnlyCollection<ParameterExpression>(result, callArgs),
761ParameterExpression callArgs = Expression.Parameter(typeof(object[]), null);
770new TrueReadOnlyCollection<ParameterExpression>(callArgs),
System\Linq\Expressions\BinaryExpression.cs (13)
190ParameterExpression temp1 = Variable(member.Expression.Type, "temp1");
203ParameterExpression temp2 = Variable(e2.Type, "temp2");
213new TrueReadOnlyCollection<ParameterExpression>(temp1, temp2),
234var vars = new ArrayBuilder<ParameterExpression>(index.ArgumentCount + 2);
237ParameterExpression tempObj = Expression.Variable(index.Object!.Type, "tempObj");
246ParameterExpression tempArg = Expression.Variable(arg.Type, "tempArg" + i);
262ParameterExpression tempValue = Expression.Variable(op.Type, "tempValue");
397ParameterExpression left = Parameter(Left.Type, "left");
398ParameterExpression right = Parameter(Right.Type, "right");
404new TrueReadOnlyCollection<ParameterExpression>(left),
413new TrueReadOnlyCollection<ParameterExpression>(right),
442private static MethodCallExpression CallGetValueOrDefault(ParameterExpression nullable)
450private static MemberExpression GetHasValueProperty(ParameterExpression nullable)
System\Linq\Expressions\BlockExpression.cs (40)
27public ReadOnlyCollection<ParameterExpression> Variables => GetOrMakeVariables();
67public BlockExpression Update(IEnumerable<ParameterExpression>? variables, IEnumerable<Expression> expressions)
73ICollection<ParameterExpression>? vars;
80vars = variables as ICollection<ParameterExpression>;
106internal virtual bool SameVariables(ICollection<ParameterExpression>? variables) =>
136internal virtual ReadOnlyCollection<ParameterExpression> GetOrMakeVariables()
138return ReadOnlyCollection<ParameterExpression>.Empty;
152internal virtual BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression>? variables, Expression[] args)
239internal override BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression>? variables, Expression[] args)
305internal override BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression>? variables, Expression[] args)
377internal override BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression>? variables, Expression[] args)
455internal override BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression>? variables, Expression[] args)
493internal override BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression>? variables, Expression[] args)
504private IReadOnlyList<ParameterExpression> _variables; // list of variables or ReadOnlyCollection if the user has accessed the read-only collection
506internal ScopeExpression(IReadOnlyList<ParameterExpression> variables)
511internal override bool SameVariables(ICollection<ParameterExpression>? variables) =>
514internal override ReadOnlyCollection<ParameterExpression> GetOrMakeVariables()
519protected IReadOnlyList<ParameterExpression> VariablesList => _variables;
522internal IReadOnlyList<ParameterExpression> ReuseOrValidateVariables(ReadOnlyCollection<ParameterExpression>? variables)
541internal Scope1(IReadOnlyList<ParameterExpression> variables, Expression body)
546private Scope1(IReadOnlyList<ParameterExpression> variables, object body)
586internal override BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression>? variables, Expression[]? args)
605internal ScopeN(IReadOnlyList<ParameterExpression> variables, IReadOnlyList<Expression> body)
625internal override BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression>? variables, Expression[]? args)
642internal ScopeWithType(IReadOnlyList<ParameterExpression> variables, IReadOnlyList<Expression> expressions, Type type)
650internal override BlockExpression Rewrite(ReadOnlyCollection<ParameterExpression>? variables, Expression[]? args)
916return Block(ReadOnlyCollection<ParameterExpression>.Empty, expressions);
939return Block(type, ReadOnlyCollection<ParameterExpression>.Empty, expressions);
948public static BlockExpression Block(IEnumerable<ParameterExpression>? variables, params Expression[] expressions)
960public static BlockExpression Block(Type type, IEnumerable<ParameterExpression>? variables, params Expression[] expressions)
971public static BlockExpression Block(IEnumerable<ParameterExpression>? variables, IEnumerable<Expression> expressions)
974ReadOnlyCollection<ParameterExpression> variableList = variables.ToReadOnly();
999public static BlockExpression Block(Type type, IEnumerable<ParameterExpression>? variables, IEnumerable<Expression> expressions)
1007ReadOnlyCollection<ParameterExpression> variableList = variables.ToReadOnly();
1027private static BlockExpression BlockCore(Type? type, ReadOnlyCollection<ParameterExpression> variables, ReadOnlyCollection<Expression> expressions)
1066internal static void ValidateVariables(ReadOnlyCollection<ParameterExpression> varList, string collectionName)
1071var set = new HashSet<ParameterExpression>();
1074ParameterExpression v = varList[i];
10920 => BlockCore(typeof(void), ReadOnlyCollection<ParameterExpression>.Empty, ReadOnlyCollection<Expression>.Empty),
System\Linq\Expressions\CatchBlock.cs (9)
16internal CatchBlock(Type test, ParameterExpression? variable, Expression body, Expression? filter)
27public ParameterExpression? Variable { get; }
62public CatchBlock Update(ParameterExpression? variable, Expression? filter, Expression body)
90/// <param name="variable">A <see cref="ParameterExpression"/> representing a reference to the <see cref="Exception"/> object caught by this handler.</param>
93public static CatchBlock Catch(ParameterExpression variable, Expression body)
116/// <param name="variable">A <see cref="ParameterExpression"/> representing a reference to the <see cref="Exception"/> object caught by this handler.</param>
120public static CatchBlock Catch(ParameterExpression variable, Expression body, Expression? filter)
130/// <param name="variable">A <see cref="ParameterExpression"/> representing a reference to the <see cref="Exception"/> object caught by this handler.</param>
135public static CatchBlock MakeCatchBlock(Type type, ParameterExpression? variable, Expression body, Expression? filter)
System\Linq\Expressions\Compiler\CompilerScope.cs (34)
64internal readonly Dictionary<ParameterExpression, VariableStorageKind> Definitions = new Dictionary<ParameterExpression, VariableStorageKind>();
70internal Dictionary<ParameterExpression, int>? ReferenceCount;
94private readonly Dictionary<ParameterExpression, Storage> _locals = new Dictionary<ParameterExpression, Storage>();
100IReadOnlyList<ParameterExpression> variables = GetVariables(node);
102Definitions = new Dictionary<ParameterExpression, VariableStorageKind>(variables.Count);
103foreach (ParameterExpression v in variables)
171internal void EmitVariableAccess(LambdaCompiler lc, ReadOnlyCollection<ParameterExpression> vars)
178foreach (ParameterExpression variable in vars)
215internal void AddLocal(LambdaCompiler gen, ParameterExpression variable)
220internal void EmitGet(ParameterExpression variable)
225internal void EmitSet(ParameterExpression variable)
230internal void EmitAddressOf(ParameterExpression variable)
235private Storage ResolveVariable(ParameterExpression variable)
244private Storage ResolveVariable(ParameterExpression variable, HoistedLocals? hoistedLocals)
296ReadOnlyCollection<ParameterExpression> hoistedVars = GetVariables().Where(p => Definitions[p] == VariableStorageKind.Hoisted).ToReadOnly();
319foreach (ParameterExpression v in _hoistedLocals.Variables)
367foreach (KeyValuePair<ParameterExpression, int> refCount in ReferenceCount)
380private bool ShouldCache(ParameterExpression v, int refCount)
388private bool ShouldCache(ParameterExpression v)
400private void CacheBoxToLocal(LambdaCompiler lc, ParameterExpression v)
420ParameterExpression v = locals.SelfVariable;
438foreach (ParameterExpression v in GetVariables())
463private IEnumerable<ParameterExpression> GetVariables() =>
466private IEnumerable<ParameterExpression> GetVariablesIncludingMerged()
468foreach (ParameterExpression param in GetVariables(Node))
475foreach (ParameterExpression param in scope.Variables)
482private static IReadOnlyList<ParameterExpression> GetVariables(object scope)
515public static int IndexOf(this IParameterProvider provider, ParameterExpression? parameter)
528public static bool Contains(this IParameterProvider provider, ParameterExpression? parameter)
534internal sealed class ParameterList : IReadOnlyList<ParameterExpression>
543public ParameterExpression this[int index]
553public IEnumerator<ParameterExpression> GetEnumerator()
System\Linq\Expressions\LambdaExpression.cs (111)
58public ReadOnlyCollection<ParameterExpression> Parameters => GetOrMakeParameters();
87internal virtual ReadOnlyCollection<ParameterExpression> GetOrMakeParameters()
93ParameterExpression IParameterProvider.GetParameter(int index) => GetParameter(index);
96internal virtual ParameterExpression GetParameter(int index)
253public Expression<TDelegate> Update(Expression body, IEnumerable<ParameterExpression>? parameters)
259ICollection<ParameterExpression>? pars;
266pars = parameters as ICollection<ParameterExpression>;
283internal virtual bool SameParameters(ICollection<ParameterExpression>? parameters)
289internal virtual Expression<TDelegate> Rewrite(Expression body, ParameterExpression[]? parameters)
307internal static Expression<TDelegate> Create(Expression body, string? name, bool tailCall, IReadOnlyList<ParameterExpression> parameters)
338public static Expression<TDelegate> CreateExpressionFunc(Expression body, string? name, bool tailCall, ReadOnlyCollection<ParameterExpression> parameters)
365internal override bool SameParameters(ICollection<ParameterExpression>? parameters) =>
368internal override ParameterExpression GetParameter(int index)
373internal override ReadOnlyCollection<ParameterExpression> GetOrMakeParameters() => ReadOnlyCollection<ParameterExpression>.Empty;
375internal override Expression<TDelegate> Rewrite(Expression body, ParameterExpression[]? parameters)
388public Expression1(Expression body, ParameterExpression par0)
396internal override ParameterExpression GetParameter(int index) =>
3990 => ExpressionUtils.ReturnObject<ParameterExpression>(_par0),
403internal override bool SameParameters(ICollection<ParameterExpression>? parameters)
407using (IEnumerator<ParameterExpression> en = parameters.GetEnumerator())
410return en.Current == ExpressionUtils.ReturnObject<ParameterExpression>(_par0);
417internal override ReadOnlyCollection<ParameterExpression> GetOrMakeParameters() => ExpressionUtils.ReturnReadOnly(this, ref _par0);
419internal override Expression<TDelegate> Rewrite(Expression body, ParameterExpression[]? parameters)
429return Expression.Lambda<TDelegate>(body, ExpressionUtils.ReturnObject<ParameterExpression>(_par0));
436private readonly ParameterExpression _par1;
438public Expression2(Expression body, ParameterExpression par0, ParameterExpression par1)
447internal override ParameterExpression GetParameter(int index) =>
4500 => ExpressionUtils.ReturnObject<ParameterExpression>(_par0),
455internal override bool SameParameters(ICollection<ParameterExpression>? parameters)
459if (_par0 is ReadOnlyCollection<ParameterExpression> alreadyCollection)
464using (IEnumerator<ParameterExpression> en = parameters.GetEnumerator())
479internal override ReadOnlyCollection<ParameterExpression> GetOrMakeParameters() => ExpressionUtils.ReturnReadOnly(this, ref _par0);
481internal override Expression<TDelegate> Rewrite(Expression body, ParameterExpression[]? parameters)
491return Expression.Lambda<TDelegate>(body, ExpressionUtils.ReturnObject<ParameterExpression>(_par0), _par1);
498private readonly ParameterExpression _par1;
499private readonly ParameterExpression _par2;
501public Expression3(Expression body, ParameterExpression par0, ParameterExpression par1, ParameterExpression par2)
511internal override ParameterExpression GetParameter(int index) =>
5140 => ExpressionUtils.ReturnObject<ParameterExpression>(_par0),
520internal override bool SameParameters(ICollection<ParameterExpression>? parameters)
524if (_par0 is ReadOnlyCollection<ParameterExpression> alreadyCollection)
529using (IEnumerator<ParameterExpression> en = parameters.GetEnumerator())
547internal override ReadOnlyCollection<ParameterExpression> GetOrMakeParameters() => ExpressionUtils.ReturnReadOnly(this, ref _par0);
549internal override Expression<TDelegate> Rewrite(Expression body, ParameterExpression[]? parameters)
559return Expression.Lambda<TDelegate>(body, ExpressionUtils.ReturnObject<ParameterExpression>(_par0), _par1, _par2);
565private IReadOnlyList<ParameterExpression> _parameters;
567public ExpressionN(Expression body, IReadOnlyList<ParameterExpression> parameters)
575internal override ParameterExpression GetParameter(int index) => _parameters[index];
577internal override bool SameParameters(ICollection<ParameterExpression>? parameters) =>
580internal override ReadOnlyCollection<ParameterExpression> GetOrMakeParameters() => ExpressionUtils.ReturnReadOnly(ref _parameters);
582internal override Expression<TDelegate> Rewrite(Expression body, ParameterExpression[]? parameters)
593public FullExpression(Expression body, string? name, bool tailCall, IReadOnlyList<ParameterExpression> parameters)
612internal static LambdaExpression CreateLambda(Type delegateType, Expression body, string? name, bool tailCall, ReadOnlyCollection<ParameterExpression> parameters)
617Func<Expression, string?, bool, ReadOnlyCollection<ParameterExpression>, LambdaExpression>? fastPath;
618CacheDict<Type, Func<Expression, string?, bool, ReadOnlyCollection<ParameterExpression>, LambdaExpression>>? factories =
619s_lambdaFactories ??= new CacheDict<Type, Func<Expression, string?, bool, ReadOnlyCollection<ParameterExpression>, LambdaExpression>>(50);
638factories[delegateType] = fastPath = (Func<Expression, string?, bool, ReadOnlyCollection<ParameterExpression>, LambdaExpression>)create.CreateDelegate(typeof(Func<Expression, string?, bool, ReadOnlyCollection<ParameterExpression>, LambdaExpression>));
649/// <param name="parameters">An array that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="LambdaExpression.Parameters"/> collection.</param>
651public static Expression<TDelegate> Lambda<TDelegate>(Expression body, params ParameterExpression[]? parameters)
653return Lambda<TDelegate>(body, false, (IEnumerable<ParameterExpression>?)parameters);
662/// <param name="parameters">An array that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="LambdaExpression.Parameters"/> collection.</param>
664public static Expression<TDelegate> Lambda<TDelegate>(Expression body, bool tailCall, params ParameterExpression[]? parameters)
666return Lambda<TDelegate>(body, tailCall, (IEnumerable<ParameterExpression>?)parameters);
674/// <param name="parameters">An <see cref="IEnumerable{T}"/> that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="LambdaExpression.Parameters"/> collection.</param>
676public static Expression<TDelegate> Lambda<TDelegate>(Expression body, IEnumerable<ParameterExpression>? parameters)
687/// <param name="parameters">An <see cref="IEnumerable{T}"/> that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="LambdaExpression.Parameters"/> collection.</param>
689public static Expression<TDelegate> Lambda<TDelegate>(Expression body, bool tailCall, IEnumerable<ParameterExpression>? parameters)
699/// <param name="parameters">An <see cref="IEnumerable{T}"/> that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="LambdaExpression.Parameters"/> collection.</param>
702public static Expression<TDelegate> Lambda<TDelegate>(Expression body, string? name, IEnumerable<ParameterExpression>? parameters)
713/// <param name="parameters">An <see cref="IEnumerable{T}"/> that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="LambdaExpression.Parameters"/> collection.</param>
716public static Expression<TDelegate> Lambda<TDelegate>(Expression body, string? name, bool tailCall, IEnumerable<ParameterExpression>? parameters)
718ReadOnlyCollection<ParameterExpression> parameterList = parameters.ToReadOnly();
734/// <param name="parameters">An array that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="LambdaExpression.Parameters"/> collection.</param>
737public static LambdaExpression Lambda(Expression body, params ParameterExpression[]? parameters)
739return Lambda(body, false, (IEnumerable<ParameterExpression>?)parameters);
747/// <param name="parameters">An array that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="LambdaExpression.Parameters"/> collection.</param>
750public static LambdaExpression Lambda(Expression body, bool tailCall, params ParameterExpression[]? parameters)
752return Lambda(body, tailCall, (IEnumerable<ParameterExpression>?)parameters);
759/// <param name="parameters">An <see cref="IEnumerable{T}"/> that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="LambdaExpression.Parameters"/> collection.</param>
762public static LambdaExpression Lambda(Expression body, IEnumerable<ParameterExpression>? parameters)
772/// <param name="parameters">An <see cref="IEnumerable{T}"/> that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="LambdaExpression.Parameters"/> collection.</param>
775public static LambdaExpression Lambda(Expression body, bool tailCall, IEnumerable<ParameterExpression>? parameters)
784/// <param name="parameters">An array that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="LambdaExpression.Parameters"/> collection.</param>
787public static LambdaExpression Lambda(Type delegateType, Expression body, params ParameterExpression[]? parameters)
797/// <param name="parameters">An array that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="LambdaExpression.Parameters"/> collection.</param>
800public static LambdaExpression Lambda(Type delegateType, Expression body, bool tailCall, params ParameterExpression[]? parameters)
809/// <param name="parameters">An <see cref="IEnumerable{T}"/> that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="LambdaExpression.Parameters"/> collection.</param>
812public static LambdaExpression Lambda(Type delegateType, Expression body, IEnumerable<ParameterExpression>? parameters)
822/// <param name="parameters">An <see cref="IEnumerable{T}"/> that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="LambdaExpression.Parameters"/> collection.</param>
825public static LambdaExpression Lambda(Type delegateType, Expression body, bool tailCall, IEnumerable<ParameterExpression>? parameters)
834/// <param name="parameters">An <see cref="IEnumerable{T}"/> that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="LambdaExpression.Parameters"/> collection.</param>
838public static LambdaExpression Lambda(Expression body, string? name, IEnumerable<ParameterExpression>? parameters)
849/// <param name="parameters">An <see cref="IEnumerable{T}"/> that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="LambdaExpression.Parameters"/> collection.</param>
852public static LambdaExpression Lambda(Expression body, string? name, bool tailCall, IEnumerable<ParameterExpression>? parameters)
856ReadOnlyCollection<ParameterExpression> parameterList = parameters.ToReadOnly();
862var set = new HashSet<ParameterExpression>();
865ParameterExpression param = parameterList[i];
885/// <param name="parameters">An <see cref="IEnumerable{T}"/> that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="LambdaExpression.Parameters"/> collection.</param>
889public static LambdaExpression Lambda(Type delegateType, Expression body, string? name, IEnumerable<ParameterExpression>? parameters)
891ReadOnlyCollection<ParameterExpression> paramList = parameters.ToReadOnly();
904/// <param name="parameters">An <see cref="IEnumerable{T}"/> that contains <see cref="ParameterExpression"/> objects to use to populate the <see cref="LambdaExpression.Parameters"/> collection.</param>
906public static LambdaExpression Lambda(Type delegateType, Expression body, string? name, bool tailCall, IEnumerable<ParameterExpression>? parameters)
908ReadOnlyCollection<ParameterExpression> paramList = parameters.ToReadOnly();
914private static void ValidateLambdaArgs(Type delegateType, ref Expression body, ReadOnlyCollection<ParameterExpression> parameters, string paramName)
944var set = new HashSet<ParameterExpression>();
947ParameterExpression pex = parameters[i];
System\Runtime\CompilerServices\CallSite.cs (16)
366var vars = new ArrayBuilder<ParameterExpression>(8 + (isVoid ? 0 : 1));
368ParameterExpression[] @params = Array.ConvertAll(invoke.GetParametersCached(), p => Expression.Parameter(p.ParameterType, p.Name));
372ParameterExpression site = @params[0];
373ParameterExpression[] arguments = @params.RemoveFirst();
375ParameterExpression @this = Expression.Variable(typeof(CallSite<T>), "this");
379ParameterExpression applicable = Expression.Variable(typeof(T[]), "applicable");
382ParameterExpression rule = Expression.Variable(typeof(T), "rule");
385ParameterExpression originalRule = Expression.Variable(typeof(T), "originalRule");
391ParameterExpression? result = null;
397ParameterExpression count = Expression.Variable(typeof(int), "count");
399ParameterExpression index = Expression.Variable(typeof(int), "index");
514ParameterExpression cache = Expression.Variable(typeof(RuleCache<T>), "cache");
596ParameterExpression args = Expression.Variable(typeof(object[]), "args");
660new TrueReadOnlyCollection<ParameterExpression>(@params)
671ParameterExpression[] @params = Array.ConvertAll(invoke.GetParametersCached(), p => Expression.Parameter(p.ParameterType, p.Name));
680new TrueReadOnlyCollection<ParameterExpression>(@params)
System.Linq.Queryable (3)
System.Private.Xml (2)