206 references to Constant
Microsoft.AspNetCore.Components.Endpoints (7)
FormMapping\Factories\ComplexType\ComplexTypeExpressionConverterFactoryOfT.cs (7)
47Expression.Assign(succeeded, Expression.Constant(true)), 288Expression.Constant(prefix)); 298Expression.Constant(message), 299Expression.NewArrayInit(typeof(object), Expression.Constant(parameter))); 315Expression.Constant(prefix)); 554Expression.Assign(foundValueParam, Expression.Constant(false)), 555Expression.Assign(succeeded, Expression.Constant(true)),
Microsoft.AspNetCore.Http.Extensions (69)
RequestDelegateFactory.cs (49)
107private static readonly BinaryExpression TempSourceStringNotNullExpr = Expression.NotEqual(TempSourceStringExpr, Expression.Constant(null)); 108private static readonly BinaryExpression TempSourceStringNullExpr = Expression.Equal(TempSourceStringExpr, Expression.Constant(null)); 449contextArgAccess[i] = Expression.Call(FilterContextExpr, EndpointFilterInvocationContextGetArgument.MakeGenericMethod(argTypes[i]), Expression.Constant(i)); 455Expression.Property(FilterContextArgumentsExpr, ListIndexer, Expression.Constant(i)), 474Expression.GreaterThanOrEqual(FilterContextHttpContextStatusCodeExpr, Expression.Constant(400)), 999Expression.Assign(StatusCodeExpr, Expression.Constant(400))), 1016Expression.Assign(StatusCodeExpr, Expression.Constant(400)), 1554var indexArguments = new[] { Expression.Constant(key) }; 1651Expression.Constant(key), 1655Expression.Constant(key), 1670var parameterTypeNameConstant = Expression.Constant(TypeNameHelper.GetTypeDisplayName(parameter.ParameterType, fullName: false)); 1671var parameterNameConstant = Expression.Constant(parameter.Name); 1672var sourceConstant = Expression.Constant(source); 1755Expression.Assign(WasParamCheckFailureExpr, Expression.Constant(true)), 1760var tryParseCall = tryParseMethodCall(parsedValue, Expression.Constant(CultureInfo.InvariantCulture)); 1773Expression.Assign(WasParamCheckFailureExpr, Expression.Constant(true)), 1809Expression.Assign(index, Expression.Constant(0)), 1840Expression.NotEqual(stringArrayExpr!, Expression.Constant(null)), 1853Expression.NotEqual(stringArrayExpr!, Expression.Constant(null)), 1897var parameterTypeNameConstant = Expression.Constant(TypeNameHelper.GetTypeDisplayName(parameter.ParameterType, fullName: false)); 1898var parameterNameConstant = Expression.Constant(parameter.Name); 1899var sourceConstant = Expression.Constant(source); 1913Expression.IfThen(Expression.Equal(argument, Expression.Constant(null)), 1915Expression.Assign(WasParamCheckFailureExpr, Expression.Constant(true)), 1937Expression.Condition(Expression.Equal(valueExpression, Expression.Convert(Expression.Constant(StringValues.Empty), parameter.ParameterType)), 1938Expression.Convert(Expression.Constant(null), parameter.ParameterType), 1953Expression.Condition(Expression.NotEqual(valueExpression, Expression.Constant(null)), 1955Expression.Convert(Expression.Constant(parameter.DefaultValue), parameter.ParameterType))); 1997Expression.Equal(boundValueExpr, Expression.Constant(null)), 1999Expression.Assign(WasParamCheckFailureExpr, Expression.Constant(true)), 2002Expression.Constant(typeName), 2003Expression.Constant(parameter.Name), 2004Expression.Constant(message), 2145Expression.Constant(CultureInfo.InvariantCulture), 2146Expression.Call(AsMemoryMethod, formBuffer, Expression.Constant(0), Expression.Constant(formDataMapperOptions.MaxKeyBufferSize)), 2165Expression.Constant(false)); 2167Expression.NotEqual(formBuffer, Expression.Constant(null)), 2170var parameterTypeNameConstant = Expression.Constant(TypeNameHelper.GetTypeDisplayName(parameter.ParameterType, fullName: false)); 2171var parameterNameConstant = Expression.Constant(parameter.Name); 2204Expression.Assign(WasParamCheckFailureExpr, Expression.Constant(true)), 2301Expression.Equal(BodyValueExpr, Expression.Constant(null)), 2303Expression.Assign(WasParamCheckFailureExpr, Expression.Constant(true)), 2306Expression.Constant(parameter.Name), 2325Expression.Equal(BodyValueExpr, Expression.Constant(null)), 2327Expression.Assign(WasParamCheckFailureExpr, Expression.Constant(true)), 2330Expression.Constant(TypeNameHelper.GetTypeDisplayName(parameter.ParameterType, fullName: false)), 2331Expression.Constant(parameter.Name), 2332Expression.Constant("body"), 2344Expression.Coalesce(BodyValueExpr, Expression.Constant(parameter.DefaultValue)),
src\Components\Endpoints\src\FormMapping\Factories\ComplexType\ComplexTypeExpressionConverterFactoryOfT.cs (7)
47Expression.Assign(succeeded, Expression.Constant(true)), 288Expression.Constant(prefix)); 298Expression.Constant(message), 299Expression.NewArrayInit(typeof(object), Expression.Constant(parameter))); 315Expression.Constant(prefix)); 554Expression.Assign(foundValueParam, Expression.Constant(false)), 555Expression.Assign(succeeded, Expression.Constant(true)),
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (7)
209var valueObj = Expression.ArrayIndex(parametersParameter, Expression.Constant(i)); 261var valueObj = Expression.ArrayIndex(parametersParameter, Expression.Constant(i)); 313Expression.Constant(null) 376Expression.Constant(getAwaiterFunc), 377Expression.Constant(isCompletedFunc), 378Expression.Constant(getResultFunc), 379Expression.Constant(onCompletedFunc),
src\Shared\ParameterBindingMethodCache.cs (6)
115Expression.Assign(success, Expression.Call(_enumTryParseMethod, Expression.Constant(type), TempSourceStringExpr, enumAsObject)), 128Expression.Constant(UriKind.RelativeOrAbsolute), 158Expression.Constant(dateTimeStyles), 167Expression.Constant(numberStyle), 252typedCall = Expression.Call(methodInfo, HttpContextExpr, Expression.Constant(parameter)); 273typedCall = Expression.Call(methodInfo, HttpContextExpr, Expression.Constant(parameter));
Microsoft.AspNetCore.Http.Extensions.Tests (7)
ParameterBindingMethodCacheTests.cs (7)
33var call = methodFound!(Expression.Variable(type, "parsedValue"), Expression.Constant(CultureInfo.InvariantCulture)) as MethodCallExpression; 51var call = methodFound!(Expression.Variable(typeof(Uri), "parsedValue"), Expression.Constant(UriKind.RelativeOrAbsolute)) as MethodCallExpression; 73var call = methodFound!(Expression.Variable(type, "parsedValue"), Expression.Constant(CultureInfo.InvariantCulture)) as MethodCallExpression; 105var call = methodFound!(Expression.Variable(type, "parsedValue"), Expression.Constant(CultureInfo.InvariantCulture)) as MethodCallExpression; 129var call = methodFound!(Expression.Variable(type, "parsedValue"), Expression.Constant(CultureInfo.InvariantCulture)) as MethodCallExpression; 183var call = methodFound!(Expression.Variable(type, "parsedValue"), Expression.Constant(CultureInfo.InvariantCulture)) as MethodCallExpression; 205var block = methodFound!(parsedValue, Expression.Constant(CultureInfo.InvariantCulture)) as BlockExpression;
Microsoft.AspNetCore.Mvc.Abstractions (6)
src\Shared\ParameterBindingMethodCache.cs (6)
115Expression.Assign(success, Expression.Call(_enumTryParseMethod, Expression.Constant(type), TempSourceStringExpr, enumAsObject)), 128Expression.Constant(UriKind.RelativeOrAbsolute), 158Expression.Constant(dateTimeStyles), 167Expression.Constant(numberStyle), 252typedCall = Expression.Call(methodInfo, HttpContextExpr, Expression.Constant(parameter)); 273typedCall = Expression.Call(methodInfo, HttpContextExpr, Expression.Constant(parameter));
Microsoft.AspNetCore.Mvc.Core (10)
ModelBinding\Binders\TryParseModelBinder.cs (1)
136Expression.Call(AddModelErrorMethod, BindingContextExpression, Expression.Constant(new FormatException()))),
ModelBinding\Metadata\DefaultModelMetadataProvider.cs (2)
276constructorArguments[i] = Expression.ArrayAccess(factoryArgumentArray, Expression.Constant(i)); 288var defaultValueExpression = Expression.Constant(defaultValue);
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (7)
209var valueObj = Expression.ArrayIndex(parametersParameter, Expression.Constant(i)); 261var valueObj = Expression.ArrayIndex(parametersParameter, Expression.Constant(i)); 313Expression.Constant(null) 376Expression.Constant(getAwaiterFunc), 377Expression.Constant(isCompletedFunc), 378Expression.Constant(getResultFunc), 379Expression.Constant(onCompletedFunc),
Microsoft.AspNetCore.Mvc.Razor (1)
Compilation\DefaultRazorPageFactoryProvider.cs (1)
49var propertyBindExpression = Expression.Bind(pathProperty, Expression.Constant(viewDescriptor.RelativePath));
Microsoft.AspNetCore.Mvc.RazorPages (1)
Infrastructure\ExecutorFactory.cs (1)
60Expression.ArrayIndex(arguments, Expression.Constant(i)),
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
CachedExpressionCompiler.cs (1)
13private static readonly Expression NullExpression = Expression.Constant(value: null);
Microsoft.AspNetCore.OpenApi (13)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (7)
209var valueObj = Expression.ArrayIndex(parametersParameter, Expression.Constant(i)); 261var valueObj = Expression.ArrayIndex(parametersParameter, Expression.Constant(i)); 313Expression.Constant(null) 376Expression.Constant(getAwaiterFunc), 377Expression.Constant(isCompletedFunc), 378Expression.Constant(getResultFunc), 379Expression.Constant(onCompletedFunc),
src\Shared\ParameterBindingMethodCache.cs (6)
115Expression.Assign(success, Expression.Call(_enumTryParseMethod, Expression.Constant(type), TempSourceStringExpr, enumAsObject)), 128Expression.Constant(UriKind.RelativeOrAbsolute), 158Expression.Constant(dateTimeStyles), 167Expression.Constant(numberStyle), 252typedCall = Expression.Call(methodInfo, HttpContextExpr, Expression.Constant(parameter)); 273typedCall = Expression.Call(methodInfo, HttpContextExpr, Expression.Constant(parameter));
Microsoft.AspNetCore.Shared.Tests (7)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (7)
209var valueObj = Expression.ArrayIndex(parametersParameter, Expression.Constant(i)); 261var valueObj = Expression.ArrayIndex(parametersParameter, Expression.Constant(i)); 313Expression.Constant(null) 376Expression.Constant(getAwaiterFunc), 377Expression.Constant(isCompletedFunc), 378Expression.Constant(getResultFunc), 379Expression.Constant(onCompletedFunc),
Microsoft.AspNetCore.SignalR.Core (7)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (7)
209var valueObj = Expression.ArrayIndex(parametersParameter, Expression.Constant(i)); 261var valueObj = Expression.ArrayIndex(parametersParameter, Expression.Constant(i)); 313Expression.Constant(null) 376Expression.Constant(getAwaiterFunc), 377Expression.Constant(isCompletedFunc), 378Expression.Constant(getResultFunc), 379Expression.Constant(onCompletedFunc),
Microsoft.CSharp (1)
Microsoft\CSharp\RuntimeBinder\BinderHelper.cs (1)
138Expression.Constant(e.Message)
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (7)
HelperFactory.cs (7)
144invokeExpression = Expression.Call(Expression.Constant(instance), method, parameterExpressions); 188invokeExpression = Expression.Call(Expression.Constant(instance), method, parameterExpressions); 280return Expression.Convert(Expression.Call(ConvertChangeType, input, Expression.Constant(output)), output); 299return Expression.Condition(input, Expression.Constant("true"), Expression.Constant("")); 316var element = Expression.ArrayIndex(argumentsParameter, Expression.Constant(index)); 325result = Expression.Call(EnumerableSkip(typeof(object)), result, Expression.Constant(index));
Microsoft.Extensions.DependencyInjection (5)
ServiceLookup\Expressions\ExpressionResolverBuilder.cs (5)
98return Expression.Constant(CallSiteRuntimeResolver.Instance.Resolve(singletonCallSite, _rootScope)); 103return Expression.Constant(constantCallSite.DefaultValue); 113return Expression.Invoke(Expression.Constant(factoryCallSite.Factory), ScopeParameter); 138return Expression.Constant( 210return Expression.Invoke(Expression.Constant(lambda), ScopeParameter);
Microsoft.Extensions.DependencyInjection.Abstractions (5)
ActivatorUtilities.cs (5)
412constructorArguments[i] = Expression.ArrayAccess(factoryArgumentArray, Expression.Constant(parameterMap[i])); 420Expression.Constant(hasDefaultValue), 429ConstantExpression? defaultValueExpression = Expression.Constant(defaultValue); 436return Expression.Block(Expression.IfThen(Expression.Equal(serviceProvider, Expression.Constant(null)), Expression.Throw(Expression.Constant(new ArgumentNullException(nameof(serviceProvider))))),
Microsoft.VisualBasic.Core (12)
Microsoft\VisualBasic\CompilerServices\IDOBinder.vb (12)
408Expression.Constant(Name), 500Expression.Constant(_lateCall) 569Expression.Constant(_reportErrors) 638Expression.Constant(_reportErrors) 694Expression.Constant(Name), 751Expression.Constant(Name), 753Expression.Constant(_optimisticSet), 754Expression.Constant(_rValueBase) 793Return New DynamicMetaObject(Expression.Constant(IDOBinder.missingMemberSentinel), IDOUtils.CreateRestrictions(target)) 1084Expression.Constant(_optimisticSet), 1085Expression.Constant(_rValueBase) 1311writeback.Add(Expression.Assign(arg, Expression.ArrayIndex(array, Expression.Constant(i))))
PresentationFramework-SystemCore (1)
DynamicAccessorImpl.cs (1)
238Expression.Constant(message)
System.ComponentModel.Composition (6)
System\ComponentModel\Composition\ConstraintServices.cs (6)
133Expression.Constant(constantKey)); 160Expression.Constant(constantKey)) 178Expression.Constant(constantValue), 183Expression.Constant(metadataName))); 197Expression.Constant(CompositionConstants.ProductDefinitionMetadataName)); 203Expression.Constant(CompositionConstants.ProductDefinitionMetadataName));
System.Composition.TypedParts (3)
System\Composition\TypedParts\ActivationFeatures\PropertyInjectionFeature.cs (1)
91Expression.Constant(d.Value.Target.GetDescriptor().Activator),
System\Composition\TypedParts\Discovery\DiscoveredPart.cs (1)
187Expression.Convert(Expression.Call(Expression.Constant(a), s_activatorInvoke, contextParam, operationParm), pi.ParameterType);
System\Composition\TypedParts\Discovery\DiscoveredPropertyExport.cs (1)
29Expression.Convert(Expression.Call(Expression.Constant(partActivator), s_activatorInvoke, args), _property.DeclaringType),
System.Linq.Expressions (21)
System\Dynamic\DynamicObject.cs (2)
615Expression.Constant(convertFailed), 620Expression.Constant("null"),
System\Dynamic\ExpandoObject.cs (3)
797Expression.Constant(name), 871Expression.Constant(binder.Name), 890Expression.Constant(binder.Name),
System\Linq\Expressions\Compiler\LambdaCompiler.cs (1)
291return Utils.GetStrongBoxValueField(Expression.Constant(new StrongBox<T>()));
System\Linq\Expressions\DynamicExpression.cs (1)
43var site = Expression.Constant(CallSite.Create(DelegateType, Binder));
System\Linq\Expressions\Interpreter\TypeOperations.cs (3)
611Expression.Constant(new Func<IRuntimeVariables, IRuntimeVariables, int[], IRuntimeVariables>(MergeRuntimeVariables)), 614Expression.Constant(indexes) 630return Expression.Convert(Utils.GetStrongBoxValueField(Expression.Constant(box)), node.Type);
System\Linq\Expressions\Utils.cs (9)
33private static readonly ConstantExpression s_true = Expression.Constant(BoxedTrue); 34private static readonly ConstantExpression s_false = Expression.Constant(BoxedFalse); 36private static readonly ConstantExpression s_m1 = Expression.Constant(BoxedIntM1); 37private static readonly ConstantExpression s_0 = Expression.Constant(BoxedInt0); 38private static readonly ConstantExpression s_1 = Expression.Constant(BoxedInt1); 39private static readonly ConstantExpression s_2 = Expression.Constant(BoxedInt2); 40private static readonly ConstantExpression s_3 = Expression.Constant(BoxedInt3); 43public static readonly ConstantExpression Null = Expression.Constant(null); 55_ => Expression.Constant(value),
System\Runtime\CompilerServices\RuntimeOps.ExpressionQuoter.cs (2)
169Expression.Constant(indexes) 180return Utils.GetStrongBoxValueField(Expression.Constant(box));
System.Linq.Queryable (16)
System\Linq\EnumerableQuery.cs (1)
47_expression = Expression.Constant(this);
System\Linq\Queryable.cs (15)
504source.Expression, Expression.Constant(count))); 522source.Expression, Expression.Constant(range))); 560source.Expression, Expression.Constant(count))); 786source.Expression, Expression.Constant(size))); 1383source.Expression, Expression.Constant(index))); 1405source.Expression, Expression.Constant(index))); 1417source.Expression, Expression.Constant(index))); 1435source.Expression, Expression.Constant(index))); 2339source.Expression, Expression.Constant(seed), Expression.Quote(func))); 2353source.Expression, Expression.Constant(seed), Expression.Quote(func), Expression.Quote(selector))); 2383source.Expression, Expression.Quote(keySelector), Expression.Constant(seed), Expression.Quote(func), Expression.Constant(keyComparer, typeof(IEqualityComparer<TKey>)))); 2426source.Expression, Expression.Constant(count) 2439source.Expression, Expression.Constant(count))); 2451source.Expression, Expression.Constant(element))); 2463source.Expression, Expression.Constant(element)));