1 type derived from NewExpression
System.Linq.Expressions (1)
System\Linq\Expressions\NewExpression.cs (1)
96internal sealed class NewValueTypeExpression : NewExpression
3 instantiations of NewExpression
System.Linq.Expressions (3)
System\Linq\Expressions\Compiler\StackSpiller.cs (1)
557return cr.Finish(cr.Rewrite ? new NewExpression(node.Constructor, cr[0, -1]!, node.Members) : expr);
System\Linq\Expressions\NewExpression.cs (2)
151return new NewExpression(constructor, argList, null); 176return new NewExpression(constructor, argList, memberList);
100 references to NewExpression
Microsoft.AspNetCore.Http.Extensions (4)
RequestDelegateFactory.cs (3)
107private static readonly NewExpression EmptyHttpResultValueTaskExpr = Expression.New(typeof(ValueTask<object>).GetConstructor(new[] { typeof(EmptyHttpResult) })!, Expression.Property(null, typeof(EmptyHttpResult), nameof(EmptyHttpResult.Instance))); 589var fallbackConstruction = Expression.New( 1587var newExpression = constructor is null ?
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (1)
327var returnValueExpression = Expression.New(
Microsoft.AspNetCore.Mvc.Core (1)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (1)
327var returnValueExpression = Expression.New(
Microsoft.AspNetCore.Mvc.Razor (1)
Compilation\DefaultRazorPageFactoryProvider.cs (1)
44var newExpression = Expression.New(viewType);
Microsoft.AspNetCore.Mvc.RazorPages (1)
Infrastructure\DefaultPageActivatorProvider.cs (1)
71var newExpression = Expression.New(pageTypeInfo);
Microsoft.AspNetCore.OpenApi (1)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (1)
327var returnValueExpression = Expression.New(
Microsoft.AspNetCore.Shared.Tests (1)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (1)
327var returnValueExpression = Expression.New(
Microsoft.AspNetCore.SignalR.Core (1)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (1)
327var returnValueExpression = Expression.New(
Microsoft.CSharp (1)
Microsoft\CSharp\RuntimeBinder\Semantics\Types\PredefinedTypes.cs (1)
166new PredefinedTypeInfo(PredefinedType.PT_NEWEXPRESSION, typeof(System.Linq.Expressions.NewExpression), "System.Linq.Expressions.NewExpression"),
netstandard (1)
netstandard.cs (1)
1020[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Linq.Expressions.NewExpression))]
System.ComponentModel.Composition.Registration (2)
System\ComponentModel\Composition\Registration\PartBuilderOfT.cs (2)
110var newExpression = (NewExpression)expr;
System.Composition.Convention (2)
System\Composition\Convention\PartConventionBuilderOfT.cs (2)
172var newExpression = (NewExpression)expr;
System.Core (1)
System.Core.cs (1)
158[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Linq.Expressions.NewExpression))]
System.Linq.Expressions (83)
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (2)
622NewExpression node = (NewExpression)expr;
System\Linq\Expressions\Compiler\StackSpiller.cs (4)
545var node = (NewExpression)expr; 668expr = new ListInitExpression((NewExpression)rewrittenNew, new TrueReadOnlyCollection<ElementInit>(newInits)); 737expr = new MemberInitExpression((NewExpression)rewrittenNew, new TrueReadOnlyCollection<MemberBinding>(newBindings));
System\Linq\Expressions\DebugViewWriter.cs (1)
803protected internal override Expression VisitNew(NewExpression node)
System\Linq\Expressions\Expression.DebuggerProxy.cs (4)
251public NewExpression NewExpression => _node.NewExpression; 306public NewExpression NewExpression => _node.NewExpression; 349private readonly NewExpression _node; 351public NewExpressionProxy(NewExpression node)
System\Linq\Expressions\ExpressionStringBuilder.cs (1)
558protected internal override Expression VisitNew(NewExpression node)
System\Linq\Expressions\ExpressionVisitor.cs (2)
427/// Visits the children of the <see cref="NewExpression"/>. 432protected internal virtual Expression VisitNew(NewExpression node)
System\Linq\Expressions\IArgumentProvider.cs (1)
9/// <see cref="NewExpression"/>, and <see cref="IndexExpression"/>).
System\Linq\Expressions\Interpreter\LightCompiler.cs (2)
2385var node = (NewExpression)expr;
System\Linq\Expressions\ListInitExpression.cs (16)
18/// Use the <see cref="Expression.ListInit(NewExpression, Expression[])"/> factory methods to create a ListInitExpression. 24internal ListInitExpression(NewExpression newExpression, ReadOnlyCollection<ElementInit> initializers) 50public NewExpression NewExpression { get; } 85public ListInitExpression Update(NewExpression newExpression, IEnumerable<ElementInit> initializers) 104/// <param name="newExpression">A <see cref="NewExpression"/> to set the <see cref="ListInitExpression.NewExpression"/> property equal to.</param> 109public static ListInitExpression ListInit(NewExpression newExpression, params Expression[] initializers) 117/// <param name="newExpression">A <see cref="NewExpression"/> to set the <see cref="ListInitExpression.NewExpression"/> property equal to.</param> 122public static ListInitExpression ListInit(NewExpression newExpression, IEnumerable<Expression> initializers) 140/// <param name="newExpression">A <see cref="NewExpression"/> to set the <see cref="ListInitExpression.NewExpression"/> property equal to.</param> 146public static ListInitExpression ListInit(NewExpression newExpression, MethodInfo? addMethod, params Expression[] initializers) 154/// <param name="newExpression">A <see cref="NewExpression"/> to set the <see cref="ListInitExpression.NewExpression"/> property equal to.</param> 160public static ListInitExpression ListInit(NewExpression newExpression, MethodInfo? addMethod, IEnumerable<Expression> initializers) 181/// <param name="newExpression">A <see cref="NewExpression"/> to set the <see cref="ListInitExpression.NewExpression"/> property equal to.</param> 191public static ListInitExpression ListInit(NewExpression newExpression, params ElementInit[] initializers) 199/// <param name="newExpression">A <see cref="NewExpression"/> to set the <see cref="ListInitExpression.NewExpression"/> property equal to.</param> 206public static ListInitExpression ListInit(NewExpression newExpression, IEnumerable<ElementInit> initializers)
System\Linq\Expressions\MemberInitExpression.cs (8)
17internal MemberInitExpression(NewExpression newExpression, ReadOnlyCollection<MemberBinding> bindings) 42/// <returns>A <see cref="Expressions.NewExpression"/> that represents the constructor call.</returns> 43public NewExpression NewExpression { get; } 122public MemberInitExpression Update(NewExpression newExpression, IEnumerable<MemberBinding> bindings) 140/// <param name="newExpression">A <see cref="NewExpression"/> to set the <see cref="MemberInitExpression.NewExpression"/> property equal to.</param> 145public static MemberInitExpression MemberInit(NewExpression newExpression, params MemberBinding[] bindings) 152/// <param name="newExpression">A <see cref="NewExpression"/> to set the <see cref="MemberInitExpression.NewExpression"/> property equal to.</param> 157public static MemberInitExpression MemberInit(NewExpression newExpression, IEnumerable<MemberBinding> bindings)
System\Linq\Expressions\NewExpression.cs (42)
81/// <param name="arguments">The <see cref="NewExpression.Arguments"/> property of the result.</param> 85public NewExpression Update(IEnumerable<Expression>? arguments) 110/// Creates a new <see cref="NewExpression"/> that represents calling the specified constructor that takes no arguments. 112/// <param name="constructor">The <see cref="ConstructorInfo"/> to set the <see cref="NewExpression.Constructor"/> property equal to.</param> 113/// <returns>A <see cref="NewExpression"/> that has the <see cref="NodeType"/> property equal to <see cref="ExpressionType.New"/> and the <see cref="NewExpression.Constructor"/> property set to the specified value.</returns> 114public static NewExpression New(ConstructorInfo constructor) 120/// Creates a new <see cref="NewExpression"/> that represents calling the specified constructor that takes no arguments. 122/// <param name="constructor">The <see cref="ConstructorInfo"/> to set the <see cref="NewExpression.Constructor"/> property equal to.</param> 124/// <returns>A <see cref="NewExpression"/> that has the <see cref="NodeType"/> property equal to <see cref="ExpressionType.New"/> and the <see cref="NewExpression.Constructor"/> and <see cref="NewExpression.Arguments"/> properties set to the specified value.</returns> 125public static NewExpression New(ConstructorInfo constructor, params Expression[]? arguments) 131/// Creates a new <see cref="NewExpression"/> that represents calling the specified constructor that takes no arguments. 133/// <param name="constructor">The <see cref="ConstructorInfo"/> to set the <see cref="NewExpression.Constructor"/> property equal to.</param> 134/// <param name="arguments">An <see cref="IEnumerable{T}"/> of <see cref="Expression"/> objects to use to populate the <see cref="NewExpression.Arguments"/> collection.</param> 135/// <returns>A <see cref="NewExpression"/> that has the <see cref="NodeType"/> property equal to <see cref="ExpressionType.New"/> and the <see cref="NewExpression.Constructor"/> and <see cref="NewExpression.Arguments"/> properties set to the specified value.</returns> 136public static NewExpression New(ConstructorInfo constructor, IEnumerable<Expression>? arguments) 155/// Creates a new <see cref="NewExpression"/> that represents calling the specified constructor with the specified arguments. The members that access the constructor initialized fields are specified. 157/// <param name="constructor">The <see cref="ConstructorInfo"/> to set the <see cref="NewExpression.Constructor"/> property equal to.</param> 158/// <param name="arguments">An <see cref="IEnumerable{T}"/> of <see cref="Expression"/> objects to use to populate the <see cref="NewExpression.Arguments"/> collection.</param> 159/// <param name="members">An <see cref="IEnumerable{T}"/> of <see cref="MemberInfo"/> objects to use to populate the <see cref="NewExpression.Members"/> collection.</param> 160/// <returns>A <see cref="NewExpression"/> that has the <see cref="NodeType"/> property equal to <see cref="ExpressionType.New"/> and the <see cref="NewExpression.Constructor"/>, <see cref="NewExpression.Arguments"/> and <see cref="NewExpression.Members"/> properties set to the specified value.</returns> 162public static NewExpression New(ConstructorInfo constructor, IEnumerable<Expression>? arguments, IEnumerable<MemberInfo>? members) 180/// Creates a new <see cref="NewExpression"/> that represents calling the specified constructor with the specified arguments. The members that access the constructor initialized fields are specified. 182/// <param name="constructor">The <see cref="ConstructorInfo"/> to set the <see cref="NewExpression.Constructor"/> property equal to.</param> 183/// <param name="arguments">An <see cref="IEnumerable{T}"/> of <see cref="Expression"/> objects to use to populate the <see cref="NewExpression.Arguments"/> collection.</param> 184/// <param name="members">An Array of <see cref="MemberInfo"/> objects to use to populate the <see cref="NewExpression.Members"/> collection.</param> 185/// <returns>A <see cref="NewExpression"/> that has the <see cref="NodeType"/> property equal to <see cref="ExpressionType.New"/> and the <see cref="NewExpression.Constructor"/>, <see cref="NewExpression.Arguments"/> and <see cref="NewExpression.Members"/> properties set to the specified value.</returns> 187public static NewExpression New(ConstructorInfo constructor, IEnumerable<Expression>? arguments, params MemberInfo[]? members) 193/// Creates a <see cref="NewExpression"/> that represents calling the parameterless constructor of the specified type. 196/// <returns>A <see cref="NewExpression"/> that has the <see cref="NodeType"/> property equal to <see cref="ExpressionType.New"/> and the <see cref="NewExpression.Constructor"/> property set to the <see cref="ConstructorInfo"/> that represents the parameterless constructor of the specified type.</returns> 197public static NewExpression New(