175 references to Convert
Microsoft.AspNetCore.Components.Endpoints (1)
FormMapping\Factories\ComplexType\ComplexTypeExpressionConverterFactoryOfT.cs (1)
186Expression.Convert(resultParam, typeof(object))));
Microsoft.AspNetCore.Components.Forms (3)
FieldIdentifier.cs (2)
190Expression expression = Expression.Convert(parameter, arg.model); 193expression = Expression.Convert(expression, typeof(object));
src\Components\Shared\src\ExpressionFormatting\ExpressionFormatter.cs (1)
278var convertExpression = Expression.Convert(parameterExpression, memberExpression.Member.DeclaringType!);
Microsoft.AspNetCore.Components.Web (1)
src\Components\Shared\src\ExpressionFormatting\ExpressionFormatter.cs (1)
278var convertExpression = Expression.Convert(parameterExpression, memberExpression.Member.DeclaringType!);
Microsoft.AspNetCore.Http.Abstractions (2)
Extensions\UseMiddlewareExtensions.cs (2)
260var methodArgument = Expression.Convert(getServiceCall, parameterType); 318middlewareInstanceArg = Expression.Convert(middlewareInstanceArg, methodInfo.DeclaringType);
Microsoft.AspNetCore.Http.Extensions (31)
RequestDelegateFactory.cs (14)
181object => Expression.Convert(TargetExpr, handler.Target.GetType()), 252var targetExpression = Expression.Convert(TargetExpr, methodInfo.DeclaringType); 548return Expression.Call(WrapObjectAsValueTaskMethod, Expression.Convert(methodCall, typeof(object))); 667factoryContext.BoxedArgs[i] = Expression.Convert(args[i], typeof(object)); 1556return Expression.Convert(indexExpression, returnType ?? typeof(string)); 1650return Expression.Call(GetKeyedServiceMethod.MakeGenericMethod(parameter.ParameterType), RequestServicesExpr, Expression.Convert( 1654return Expression.Call(GetRequiredKeyedServiceMethod.MakeGenericMethod(parameter.ParameterType), RequestServicesExpr, Expression.Convert( 1786Expression.Assign(parameter.ParameterType.IsArray ? Expression.ArrayAccess(argument, index) : argument, Expression.Convert(parsedValue, targetParseType)), 1937Expression.Condition(Expression.Equal(valueExpression, Expression.Convert(Expression.Constant(StringValues.Empty), parameter.ParameterType)), 1938Expression.Convert(Expression.Constant(null), parameter.ParameterType), 1955Expression.Convert(Expression.Constant(parameter.DefaultValue), parameter.ParameterType))); 2014return Expression.Convert(boundValueExpr, parameter.ParameterType); 2343return Expression.Convert( 2349return Expression.Convert(BodyValueExpr, parameter.ParameterType);
src\Components\Endpoints\src\FormMapping\Factories\ComplexType\ComplexTypeExpressionConverterFactoryOfT.cs (1)
186Expression.Convert(resultParam, typeof(object))));
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (14)
210var valueCast = Expression.Convert(valueObj, paramInfo.ParameterType); 217var instanceCast = Expression.Convert(targetParameter, targetTypeInfo.AsType()); 231var castMethodCall = Expression.Convert(methodCall, typeof(object)); 262var valueCast = Expression.Convert(valueObj, paramInfo.ParameterType); 269var instanceCast = Expression.Convert(targetParameter, targetTypeInfo.AsType()); 283Expression.Convert( 285Expression.Convert(customAwaitableParam, postCoercionMethodReturnType), 295Expression.Convert(isCompletedParam, awaitableInfo.AwaiterType), 311Expression.Convert(getResultParam, awaitableInfo.AwaiterType), 322Expression.Convert( 324Expression.Convert(getResultParam, awaitableInfo.AwaiterType), 337Expression.Convert(onCompletedParam1, awaitableInfo.AwaiterType), 353Expression.Convert(unsafeOnCompletedParam1, awaitableInfo.AwaiterType), 375Expression.Convert(coercedMethodCall, typeof(object)),
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (1)
155return Expression.Lambda(Expression.Convert(closedGenericTaskParam, typeof(Task)), closedGenericTaskParam);
src\Shared\ParameterBindingMethodCache.cs (1)
117Expression.Condition(success, Expression.Convert(enumAsObject, type), Expression.Default(type))),
Microsoft.AspNetCore.JsonPatch (1)
JsonPatchDocumentOfT.cs (1)
731var converted = Expression.Convert(expression, typeof(object));
Microsoft.AspNetCore.Mvc.Abstractions (1)
src\Shared\ParameterBindingMethodCache.cs (1)
117Expression.Condition(success, Expression.Convert(enumAsObject, type), Expression.Default(type))),
Microsoft.AspNetCore.Mvc.Core (17)
ModelBinding\Binders\TryParseModelBinder.cs (1)
134Expression.Assign(modelValue, Expression.Convert(parsedValue, modelValue.Type)),
ModelBinding\Metadata\DefaultModelMetadataProvider.cs (1)
292constructorArguments[i] = Expression.Convert(constructorArguments[i], parameterType);
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (14)
210var valueCast = Expression.Convert(valueObj, paramInfo.ParameterType); 217var instanceCast = Expression.Convert(targetParameter, targetTypeInfo.AsType()); 231var castMethodCall = Expression.Convert(methodCall, typeof(object)); 262var valueCast = Expression.Convert(valueObj, paramInfo.ParameterType); 269var instanceCast = Expression.Convert(targetParameter, targetTypeInfo.AsType()); 283Expression.Convert( 285Expression.Convert(customAwaitableParam, postCoercionMethodReturnType), 295Expression.Convert(isCompletedParam, awaitableInfo.AwaiterType), 311Expression.Convert(getResultParam, awaitableInfo.AwaiterType), 322Expression.Convert( 324Expression.Convert(getResultParam, awaitableInfo.AwaiterType), 337Expression.Convert(onCompletedParam1, awaitableInfo.AwaiterType), 353Expression.Convert(unsafeOnCompletedParam1, awaitableInfo.AwaiterType), 375Expression.Convert(coercedMethodCall, typeof(object)),
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (1)
155return Expression.Lambda(Expression.Convert(closedGenericTaskParam, typeof(Task)), closedGenericTaskParam);
Microsoft.AspNetCore.Mvc.RazorPages (7)
Infrastructure\ExecutorFactory.cs (7)
59unpackExpressions[i] = Expression.Convert( 89Expression.Convert(receiver, method.DeclaringType!), 120Expression.Convert( 122Expression.Convert(receiver, method.DeclaringType!), 155Expression.Convert(receiver, method.DeclaringType!), 180Expression.Convert( 182Expression.Convert(receiver, method.DeclaringType!),
Microsoft.AspNetCore.Mvc.ViewFeatures (5)
CachedExpressionCompiler.cs (2)
177Expression.Convert(parameterExpression, memberExpression.Member.DeclaringType); 218body = Expression.Convert(body, typeof(object));
ExpressionHelper.cs (1)
213var converted = Expression.Convert(indexExpression, typeof(object));
ViewDataDictionaryFactory.cs (2)
25Expression.Convert( 45Expression.Convert(
Microsoft.AspNetCore.OpenApi (16)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (14)
210var valueCast = Expression.Convert(valueObj, paramInfo.ParameterType); 217var instanceCast = Expression.Convert(targetParameter, targetTypeInfo.AsType()); 231var castMethodCall = Expression.Convert(methodCall, typeof(object)); 262var valueCast = Expression.Convert(valueObj, paramInfo.ParameterType); 269var instanceCast = Expression.Convert(targetParameter, targetTypeInfo.AsType()); 283Expression.Convert( 285Expression.Convert(customAwaitableParam, postCoercionMethodReturnType), 295Expression.Convert(isCompletedParam, awaitableInfo.AwaiterType), 311Expression.Convert(getResultParam, awaitableInfo.AwaiterType), 322Expression.Convert( 324Expression.Convert(getResultParam, awaitableInfo.AwaiterType), 337Expression.Convert(onCompletedParam1, awaitableInfo.AwaiterType), 353Expression.Convert(unsafeOnCompletedParam1, awaitableInfo.AwaiterType), 375Expression.Convert(coercedMethodCall, typeof(object)),
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (1)
155return Expression.Lambda(Expression.Convert(closedGenericTaskParam, typeof(Task)), closedGenericTaskParam);
src\Shared\ParameterBindingMethodCache.cs (1)
117Expression.Condition(success, Expression.Convert(enumAsObject, type), Expression.Default(type))),
Microsoft.AspNetCore.Shared.Tests (15)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (14)
210var valueCast = Expression.Convert(valueObj, paramInfo.ParameterType); 217var instanceCast = Expression.Convert(targetParameter, targetTypeInfo.AsType()); 231var castMethodCall = Expression.Convert(methodCall, typeof(object)); 262var valueCast = Expression.Convert(valueObj, paramInfo.ParameterType); 269var instanceCast = Expression.Convert(targetParameter, targetTypeInfo.AsType()); 283Expression.Convert( 285Expression.Convert(customAwaitableParam, postCoercionMethodReturnType), 295Expression.Convert(isCompletedParam, awaitableInfo.AwaiterType), 311Expression.Convert(getResultParam, awaitableInfo.AwaiterType), 322Expression.Convert( 324Expression.Convert(getResultParam, awaitableInfo.AwaiterType), 337Expression.Convert(onCompletedParam1, awaitableInfo.AwaiterType), 353Expression.Convert(unsafeOnCompletedParam1, awaitableInfo.AwaiterType), 375Expression.Convert(coercedMethodCall, typeof(object)),
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (1)
155return Expression.Lambda(Expression.Convert(closedGenericTaskParam, typeof(Task)), closedGenericTaskParam);
Microsoft.AspNetCore.SignalR.Core (16)
Internal\HubMethodDescriptor.cs (1)
241Expression.Convert(parameters[0], methodParameters[0].ParameterType),
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (14)
210var valueCast = Expression.Convert(valueObj, paramInfo.ParameterType); 217var instanceCast = Expression.Convert(targetParameter, targetTypeInfo.AsType()); 231var castMethodCall = Expression.Convert(methodCall, typeof(object)); 262var valueCast = Expression.Convert(valueObj, paramInfo.ParameterType); 269var instanceCast = Expression.Convert(targetParameter, targetTypeInfo.AsType()); 283Expression.Convert( 285Expression.Convert(customAwaitableParam, postCoercionMethodReturnType), 295Expression.Convert(isCompletedParam, awaitableInfo.AwaiterType), 311Expression.Convert(getResultParam, awaitableInfo.AwaiterType), 322Expression.Convert( 324Expression.Convert(getResultParam, awaitableInfo.AwaiterType), 337Expression.Convert(onCompletedParam1, awaitableInfo.AwaiterType), 353Expression.Convert(unsafeOnCompletedParam1, awaitableInfo.AwaiterType), 375Expression.Convert(coercedMethodCall, typeof(object)),
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (1)
155return Expression.Lambda(Expression.Convert(closedGenericTaskParam, typeof(Task)), closedGenericTaskParam);
Microsoft.CodeAnalysis.EditorFeatures.Wpf (15)
Lightup\LightupHelpers.cs (15)
90: Expression.Convert(parameter, type); 94Expression.Convert(Expression.Call(instance, property.GetMethod), typeof(TResult)), 142: Expression.Convert(parameter, type); 210: Expression.Convert(parameter, type); 214: Expression.Convert(argument, argType); 274Expression.Convert(Expression.Call(null, method), typeof(TResult)), 326: Expression.Convert(parameter, type); 330Expression.Convert(Expression.Call(instance, method), typeof(TResult)), 392: Expression.Convert(parameter, type); 396: Expression.Convert(argument, argType); 400Expression.Convert( 478: Expression.Convert(parameter, type); 482: Expression.Convert(argument0, arg0Type); 486: Expression.Convert(argument1, arg1Type); 490Expression.Convert(
Microsoft.CSharp (4)
Microsoft\CSharp\RuntimeBinder\BinderHelper.cs (3)
118Expression.Assign(tempForIncrement, Expression.Convert(arg0.Expression, arg0.Value.GetType())), 120Expression.Assign(arg0.Expression, Expression.Convert(tempForIncrement, arg0.Expression.Type))); 274return Expression.Convert(binding, action.ReturnType);
Microsoft\CSharp\RuntimeBinder\ExpressionTreeCallRewriter.cs (1)
376return Expression.Convert(e, t);
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (2)
HelperFactory.cs (2)
280return Expression.Convert(Expression.Call(ConvertChangeType, input, Expression.Constant(output)), output); 292return Expression.Convert(input, output);
Microsoft.Extensions.DependencyInjection (2)
ServiceLookup\Expressions\ExpressionResolverBuilder.cs (2)
190expression = Expression.Convert(expression, typeof(object)); 204return Expression.Convert(expression, type);
Microsoft.Extensions.DependencyInjection.Abstractions (1)
ActivatorUtilities.cs (1)
433constructorArguments[i] = Expression.Convert(constructorArguments[i], parameterType);
Microsoft.VisualBasic.Core (2)
Microsoft\VisualBasic\CompilerServices\IDOBinder.vb (2)
848Return New DynamicMetaObject(Expression.Convert(fallback, ReturnType), IDOUtils.CreateRestrictions(target)) 1326Return If(valueExpression.Type.Equals(GetType(Object)), valueExpression, Expression.Convert(valueExpression, GetType(Object)))
PresentationFramework (8)
MS\Internal\WindowsRuntime\Generated\WinRT\Marshalers.cs (8)
372Expression.Convert(Expression.Call(HelperType.GetMethod("CreateMarshaler", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static), parms), 381Expression.Convert(Expression.Call(HelperType.GetMethod("GetAbi", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static), 382new[] { Expression.Convert(parms[0], MarshalerType) }), 394new Expression[] { Expression.Convert(parms[0], MarshalerType), parms[1] }), parms).Compile(); 403new[] { Expression.Convert(parms[0], AbiType) }), parms).Compile(); 411Expression.Convert(Expression.Call(HelperType.GetMethod("FromManaged", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static), parms), 431new[] { Expression.Convert(parms[0], MarshalerType) }), parms).Compile(); 896Expression.Convert(parms[0], HelperType),
System.ComponentModel.Composition (1)
System\ComponentModel\Composition\ConstraintServices.cs (1)
208Expression.Convert(productExportDefinitionExpression, typeof(ExportDefinition)));
System.Composition.TypedParts (6)
System\Composition\TypedParts\ActivationFeatures\OnImportsSatisfiedFeature.cs (1)
55Expression.Call(Expression.Convert(ois, partType.AsType()), m), ois).Compile();
System\Composition\TypedParts\ActivationFeatures\PropertyInjectionFeature.cs (2)
80var assignTyped = Expression.Assign(typed, Expression.Convert(inst, partType.AsType())); 89Expression.Convert(
System\Composition\TypedParts\Discovery\DiscoveredPart.cs (2)
187Expression.Convert(Expression.Call(Expression.Constant(a), s_activatorInvoke, contextParam, operationParm), pi.ParameterType); 195Expression body = Expression.Convert(Expression.New(_constructor, paramActivatorCalls), typeof(object));
System\Composition\TypedParts\Discovery\DiscoveredPropertyExport.cs (1)
29Expression.Convert(Expression.Call(Expression.Constant(partActivator), s_activatorInvoke, args), _property.DeclaringType),
System.Linq.Expressions (18)
System\Dynamic\BindingRestrictions.cs (2)
303Expression.Convert(_expression, typeof(object)), 330Expression.Convert(_expression, typeof(object)),
System\Dynamic\DynamicObject.cs (5)
447paramArgs[i] = Expression.Convert(args[i], typeof(object)); 473Expression.Convert( 581UnaryExpression convert = Expression.Convert(resultMO.Expression, binder.ReturnType); 718Expression.Assign(result, Expression.Convert(value, typeof(object))) 851return Expression.Convert(Expression, typeof(DynamicObject));
System\Dynamic\ExpandoObject.cs (2)
870Expression.Convert(value.Expression, typeof(object)), 1001return Expression.Convert(Expression, LimitType);
System\Linq\Expressions\BinaryExpression.cs (1)
418Convert(
System\Linq\Expressions\Compiler\LambdaCompiler.Unary.cs (2)
316UnaryExpression operand = Expression.Convert(node.Operand, paramType); 319node = Expression.Convert(Expression.Call(node.Method, operand), node.Type);
System\Linq\Expressions\Interpreter\TypeOperations.cs (1)
630return Expression.Convert(Utils.GetStrongBoxValueField(Expression.Constant(box)), node.Type);
System\Runtime\CompilerServices\CallSite.cs (4)
377body.UncheckedAdd(Expression.Assign(@this, Expression.Convert(site, @this.Type))); 486Expression.Convert(rule, typeof(object)), 487Expression.Convert(originalRule, typeof(object)) 690return Expression.Convert(arg, type);
System\Runtime\CompilerServices\CallSiteBinder.cs (1)
185Expression.Convert(site, siteType),