1 type derived from NewExpression
System.Linq.Expressions (1)
System\Linq\Expressions\NewExpression.cs (1)
96
internal sealed class NewValueTypeExpression :
NewExpression
3 instantiations of NewExpression
System.Linq.Expressions (3)
System\Linq\Expressions\Compiler\StackSpiller.cs (1)
557
return cr.Finish(cr.Rewrite ? new
NewExpression
(node.Constructor, cr[0, -1]!, node.Members) : expr);
System\Linq\Expressions\NewExpression.cs (2)
151
return new
NewExpression
(constructor, argList, null);
176
return new
NewExpression
(constructor, argList, memberList);
103 references to NewExpression
Microsoft.AspNetCore.Http.Extensions (4)
RequestDelegateFactory.cs (3)
105
private static readonly
NewExpression
EmptyHttpResultValueTaskExpr = Expression.New(typeof(ValueTask<object>).GetConstructor(new[] { typeof(EmptyHttpResult) })!, Expression.Property(null, typeof(EmptyHttpResult), nameof(EmptyHttpResult.Instance)));
592
var
fallbackConstruction = Expression.New(
1617
var
newExpression = constructor is null ?
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (1)
373
var
returnValueExpression = Expression.New(
Microsoft.AspNetCore.Mvc.Core (1)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (1)
373
var
returnValueExpression = Expression.New(
Microsoft.AspNetCore.Mvc.Razor (1)
Compilation\DefaultRazorPageFactoryProvider.cs (1)
44
var
newExpression = Expression.New(viewType);
Microsoft.AspNetCore.Mvc.RazorPages (1)
Infrastructure\DefaultPageActivatorProvider.cs (1)
71
var
newExpression = Expression.New(pageTypeInfo);
Microsoft.AspNetCore.OpenApi (1)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (1)
373
var
returnValueExpression = Expression.New(
Microsoft.AspNetCore.Shared.Tests (1)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (1)
373
var
returnValueExpression = Expression.New(
Microsoft.AspNetCore.SignalR.Core (1)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (1)
373
var
returnValueExpression = Expression.New(
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Protocol\Converters\StringEnumConverter.cs (1)
34
var
body = Expression.New(constructor, param);
Protocol\Converters\SumConverter.cs (1)
158
var
body = Expression.New(
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (1)
ExpressionTrees\Sources\ExprLambdaUtils.vb (1)
357
Protected Overrides Function VisitNew(node As
NewExpression
) As Expression
Microsoft.CSharp (1)
Microsoft\CSharp\RuntimeBinder\Semantics\Types\PredefinedTypes.cs (1)
166
new 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)
110
var
newExpression = (
NewExpression
)expr;
System.Composition.Convention (2)
System\Composition\Convention\PartConventionBuilderOfT.cs (2)
172
var
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)
622
NewExpression
node = (
NewExpression
)expr;
System\Linq\Expressions\Compiler\StackSpiller.cs (4)
545
var
node = (
NewExpression
)expr;
668
expr = new ListInitExpression((
NewExpression
)rewrittenNew, new TrueReadOnlyCollection<ElementInit>(newInits));
737
expr = new MemberInitExpression((
NewExpression
)rewrittenNew, new TrueReadOnlyCollection<MemberBinding>(newBindings));
System\Linq\Expressions\DebugViewWriter.cs (1)
803
protected internal override Expression VisitNew(
NewExpression
node)
System\Linq\Expressions\Expression.DebuggerProxy.cs (4)
251
public
NewExpression
NewExpression => _node.NewExpression;
306
public
NewExpression
NewExpression => _node.NewExpression;
349
private readonly
NewExpression
_node;
351
public NewExpressionProxy(
NewExpression
node)
System\Linq\Expressions\ExpressionStringBuilder.cs (1)
558
protected internal override Expression VisitNew(
NewExpression
node)
System\Linq\Expressions\ExpressionVisitor.cs (2)
427
/// Visits the children of the <see cref="
NewExpression
"/>.
432
protected 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)
2385
var
node = (
NewExpression
)expr;
System\Linq\Expressions\ListInitExpression.cs (16)
18
/// Use the <see cref="Expression.ListInit(
NewExpression
, Expression[])"/> factory methods to create a ListInitExpression.
24
internal ListInitExpression(
NewExpression
newExpression, ReadOnlyCollection<ElementInit> initializers)
50
public
NewExpression
NewExpression { get; }
85
public 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>
109
public 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>
122
public 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>
146
public 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>
160
public 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>
191
public 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>
206
public static ListInitExpression ListInit(
NewExpression
newExpression, IEnumerable<ElementInit> initializers)
System\Linq\Expressions\MemberInitExpression.cs (8)
17
internal MemberInitExpression(
NewExpression
newExpression, ReadOnlyCollection<MemberBinding> bindings)
42
/// <returns>A <see cref="Expressions.
NewExpression
"/> that represents the constructor call.</returns>
43
public
NewExpression
NewExpression { get; }
122
public 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>
145
public 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>
157
public 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>
85
public
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>
114
public 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>
125
public 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>
136
public 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>
162
public 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>
187
public 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>
197
public static
NewExpression
New(