2 types derived from MemberExpression
System.Linq.Expressions (2)
System\Linq\Expressions\MemberExpression.cs (2)
88internal sealed class FieldExpression : MemberExpression 103internal sealed class PropertyExpression : MemberExpression
181 references to MemberExpression
Microsoft.AspNetCore.Components.Forms (10)
FieldIdentifier.cs (3)
109case MemberExpression memberExpression: 121case MemberExpression member when member.Expression is ConstantExpression: 154MemberExpression member,
src\Components\Shared\src\ExpressionFormatting\ExpressionFormatter.cs (7)
101var memberExpression = (MemberExpression)node; 207case MemberExpression memberExpression when memberExpression.Expression is ConstantExpression constantExpression: 234private static void FormatCapturedValue(MemberExpression memberExpression, ConstantExpression constantExpression, ref ReverseStringBuilder builder) 246private static CapturedValueFormatter CreateCapturedValueFormatter(MemberExpression memberExpression) 275static Func<object, TResult> CompileMemberEvaluator<TResult>(MemberExpression memberExpression) 279var replacedMemberExpression = memberExpression.Update(convertExpression);
Microsoft.AspNetCore.Components.Forms.Tests (3)
FieldIdentifierTest.cs (3)
152var body = expression.Body as MemberExpression; 153var value = FieldIdentifier.GetModelFromMemberAccess((MemberExpression)body.Expression, cache);
Microsoft.AspNetCore.Components.QuickGrid (5)
Columns\GridSort.cs (4)
138if (expression.Body is not MemberExpression body) 151var node = body; 154if (node.Expression is MemberExpression parentMember) 181body = (body.Expression as MemberExpression)!;
Columns\PropertyColumn.cs (1)
71if (Title is null && Property.Body is MemberExpression memberExpression)
Microsoft.AspNetCore.Components.Web (7)
src\Components\Shared\src\ExpressionFormatting\ExpressionFormatter.cs (7)
101var memberExpression = (MemberExpression)node; 207case MemberExpression memberExpression when memberExpression.Expression is ConstantExpression constantExpression: 234private static void FormatCapturedValue(MemberExpression memberExpression, ConstantExpression constantExpression, ref ReverseStringBuilder builder) 246private static CapturedValueFormatter CreateCapturedValueFormatter(MemberExpression memberExpression) 275static Func<object, TResult> CompileMemberEvaluator<TResult>(MemberExpression memberExpression) 279var replacedMemberExpression = memberExpression.Update(convertExpression);
Microsoft.AspNetCore.Http.Extensions (22)
RequestDelegateFactory.cs (22)
91private static readonly MemberExpression RequestServicesExpr = Expression.Property(HttpContextExpr, typeof(HttpContext).GetProperty(nameof(HttpContext.RequestServices))!); 92private static readonly MemberExpression HttpRequestExpr = Expression.Property(HttpContextExpr, typeof(HttpContext).GetProperty(nameof(HttpContext.Request))!); 93private static readonly MemberExpression HttpResponseExpr = Expression.Property(HttpContextExpr, typeof(HttpContext).GetProperty(nameof(HttpContext.Response))!); 94private static readonly MemberExpression RequestAbortedExpr = Expression.Property(HttpContextExpr, typeof(HttpContext).GetProperty(nameof(HttpContext.RequestAborted))!); 95private static readonly MemberExpression UserExpr = Expression.Property(HttpContextExpr, typeof(HttpContext).GetProperty(nameof(HttpContext.User))!); 96private static readonly MemberExpression RouteValuesExpr = Expression.Property(HttpRequestExpr, typeof(HttpRequest).GetProperty(nameof(HttpRequest.RouteValues))!); 97private static readonly MemberExpression QueryExpr = Expression.Property(HttpRequestExpr, typeof(HttpRequest).GetProperty(nameof(HttpRequest.Query))!); 98private static readonly MemberExpression HeadersExpr = Expression.Property(HttpRequestExpr, typeof(HttpRequest).GetProperty(nameof(HttpRequest.Headers))!); 99private static readonly MemberExpression FormExpr = Expression.Property(HttpRequestExpr, typeof(HttpRequest).GetProperty(nameof(HttpRequest.Form))!); 100private static readonly MemberExpression RequestStreamExpr = Expression.Property(HttpRequestExpr, typeof(HttpRequest).GetProperty(nameof(HttpRequest.Body))!); 101private static readonly MemberExpression RequestPipeReaderExpr = Expression.Property(HttpRequestExpr, typeof(HttpRequest).GetProperty(nameof(HttpRequest.BodyReader))!); 102private static readonly MemberExpression FormFilesExpr = Expression.Property(FormExpr, typeof(IFormCollection).GetProperty(nameof(IFormCollection.Files))!); 103private static readonly MemberExpression StatusCodeExpr = Expression.Property(HttpResponseExpr, typeof(HttpResponse).GetProperty(nameof(HttpResponse.StatusCode))!); 104private static readonly MemberExpression CompletedTaskExpr = Expression.Property(null, (PropertyInfo)GetMemberInfo<Func<Task>>(() => Task.CompletedTask)); 115private static readonly MemberExpression FilterContextHttpContextExpr = Expression.Property(FilterContextExpr, typeof(EndpointFilterInvocationContext).GetProperty(nameof(EndpointFilterInvocationContext.HttpContext))!); 116private static readonly MemberExpression FilterContextArgumentsExpr = Expression.Property(FilterContextExpr, typeof(EndpointFilterInvocationContext).GetProperty(nameof(EndpointFilterInvocationContext.Arguments))!); 117private static readonly MemberExpression FilterContextHttpContextResponseExpr = Expression.Property(FilterContextHttpContextExpr, typeof(HttpContext).GetProperty(nameof(HttpContext.Response))!); 118private static readonly MemberExpression FilterContextHttpContextStatusCodeExpr = Expression.Property(FilterContextHttpContextResponseExpr, typeof(HttpResponse).GetProperty(nameof(HttpResponse.StatusCode))!); 1552private static Expression GetValueFromProperty(MemberExpression sourceExpression, PropertyInfo itemProperty, string key, Type? returnType = null) 1958private static Expression BindParameterFromProperty(ParameterInfo parameter, MemberExpression property, PropertyInfo itemProperty, string key, RequestDelegateFactoryContext factoryContext, string source) => 2378var mc = (MemberExpression)expr.Body;
Microsoft.AspNetCore.Http.Results.Tests (1)
ResultsTests.cs (1)
1723MemberExpression me => me.Member.Name,
Microsoft.AspNetCore.JsonPatch (3)
JsonPatchDocumentOfT.cs (3)
698var memberExpression = expr as MemberExpression; 713private string GetPropertyNameFromMemberExpression(MemberExpression memberExpression)
Microsoft.AspNetCore.Mvc.Core (5)
ModelBinding\Binders\TryParseModelBinder.cs (3)
21private static readonly MemberExpression BindingResultExpression = Expression.Property(BindingContextExpression, nameof(ModelBindingContext.Result)); 22private static readonly MemberExpression ValueExpression = Expression.Property(ValueProviderResultExpression, nameof(ValueProviderResult.FirstValue)); 23private static readonly MemberExpression CultureExpression = Expression.Property(ValueProviderResultExpression, nameof(ValueProviderResult.Culture));
ModelBinding\ModelBindingHelper.cs (2)
301var memberExpression = (MemberExpression)expression;
Microsoft.AspNetCore.Mvc.ViewFeatures (30)
CachedExpressionCompiler.cs (14)
58case MemberExpression memberExpression when memberExpression.Expression is ConstantExpression constantExpression: 62case MemberExpression memberExpression when memberExpression.Expression == null: 66case MemberExpression memberExpression when memberExpression.Expression == expression.Parameters[0]: 70case MemberExpression memberExpression when IsChainedPropertyAccessor(memberExpression): 77bool IsChainedPropertyAccessor(MemberExpression memberExpression) 81if (memberExpression.Expression is MemberExpression leftExpression) 122MemberExpression memberExpression) 139MemberExpression memberExpression) 154MemberExpression memberExpression) 169private static Func<TModel, object> CompileCapturedConstant(MemberExpression memberExpression, ConstantExpression constantExpression) 178var replacementMemberExpression = memberExpression.Update(castExpression); 193MemberExpression memberExpression) 196var currentExpression = memberExpression; 202if (currentExpression.Expression is MemberExpression leftExpression)
ExpressionHelper.cs (4)
84var memberExpressionPart = (MemberExpression)part; 166var memberExpression = (MemberExpression)part;
ExpressionMetadataProvider.cs (2)
44var memberExpression = (MemberExpression)expression.Body;
LambdaExpressionComparer.cs (6)
45var memberExpression1 = (MemberExpression)expression1; 49var memberExpression2 = (MemberExpression)expression2; 90var memberExpression = (MemberExpression)expression;
MemberExpressionCacheKey.cs (4)
11public MemberExpressionCacheKey(Type modelType, MemberExpression memberExpression) 39public MemberExpression MemberExpression { get; } 51private MemberExpression _memberExpression; 83_memberExpression = _memberExpression.Expression as MemberExpression;
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (4)
MemberExpressionCacheKeyComparerTest.cs (2)
192var memberExpression = Assert.IsAssignableFrom<MemberExpression>(expression.Body);
MemberExpressionCacheKeyTest.cs (2)
72var memberExpression = Assert.IsAssignableFrom<MemberExpression>(expression.Body);
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (1)
ExpressionTrees\Sources\ExprLambdaUtils.vb (1)
334Protected Overrides Function VisitMember(node As MemberExpression) As Expression
Microsoft.CSharp (1)
Microsoft\CSharp\RuntimeBinder\Semantics\Types\PredefinedTypes.cs (1)
164new PredefinedTypeInfo(PredefinedType.PT_MEMBEREXPRESSION, typeof(System.Linq.Expressions.MemberExpression), "System.Linq.Expressions.MemberExpression"),
Microsoft.DotNet.Build.Tasks.Packaging (4)
Extensions.cs (4)
147var memberSelectorExpression = memberLamda.Body as MemberExpression; 169var memberSelectorExpression = memberLamda.Body as MemberExpression;
Microsoft.VisualStudio.LanguageServices.Test.Utilities2 (1)
PropertyChangedTestMonitor.vb (1)
27Dim propertyName = DirectCast(expectation.Body, MemberExpression).Member.Name
netstandard (1)
netstandard.cs (1)
1014[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Linq.Expressions.MemberExpression))]
System.ComponentModel.Composition.Registration (1)
System\ComponentModel\Composition\Registration\PartBuilderOfT.cs (1)
52MemberInfo memberInfo = ((MemberExpression)expr).Member;
System.Composition.Convention (1)
System\Composition\Convention\PartConventionBuilderOfT.cs (1)
111var memberInfo = ((MemberExpression)expr).Member as PropertyInfo;
System.Core (1)
System.Core.cs (1)
152[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Linq.Expressions.MemberExpression))]
System.Linq.Expressions (79)
System\Dynamic\Utils\ExpressionUtils.cs (2)
206MemberExpression member = (MemberExpression)expression;
System\Linq\Expressions\BinaryExpression.cs (3)
175MemberExpression member = (MemberExpression)Left; 450private static MemberExpression GetHasValueProperty(ParameterExpression nullable)
System\Linq\Expressions\Compiler\LambdaCompiler.Address.cs (5)
43AddressOf((MemberExpression)node, type); 112private void AddressOf(MemberExpression node, Type type) 242result = AddressOfWriteBack((MemberExpression)node); 259private WriteBack? AddressOfWriteBack(MemberExpression node) 270private WriteBack AddressOfWriteBackCore(MemberExpression node)
System\Linq\Expressions\Compiler\LambdaCompiler.cs (1)
283private MemberExpression CreateLazyInitializedField<T>(string name)
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (4)
789MemberExpression lvalue = (MemberExpression)node.Left; 833MemberExpression node = (MemberExpression)expr;
System\Linq\Expressions\Compiler\LambdaCompiler.Statements.cs (1)
688MemberExpression dictField = CreateLazyInitializedField<Dictionary<string, int>>("dictionarySwitch");
System\Linq\Expressions\Compiler\StackSpiller.Bindings.cs (5)
99Expression member = MemberExpression.Make(target, _binding.Member); 117new AssignBinaryExpression(MemberExpression.Make(target, _binding.Member), memberTemp) 184Expression member = MemberExpression.Make(target, _binding.Member); 203new AssignBinaryExpression(MemberExpression.Make(target, _binding.Member), memberTemp) 237Expression member = MemberExpression.Make(target, _binding.Member);
System\Linq\Expressions\Compiler\StackSpiller.ChildRewriter.cs (2)
266var member = (MemberExpression)expression;
System\Linq\Expressions\Compiler\StackSpiller.cs (6)
353var lvalue = (MemberExpression)node.Left; 373MemberExpression.Make(cr[0], lvalue.Member), 384var node = (MemberExpression)expr; 398expr = MemberExpression.Make(expression.Node, node.Member);
System\Linq\Expressions\DebugViewWriter.cs (1)
539protected internal override Expression VisitMember(MemberExpression node)
System\Linq\Expressions\Expression.cs (1)
262MemberInfo member = ((MemberExpression)expression).Member;
System\Linq\Expressions\Expression.DebuggerProxy.cs (2)
277private readonly MemberExpression _node; 279public MemberExpressionProxy(MemberExpression node)
System\Linq\Expressions\ExpressionStringBuilder.cs (1)
408protected internal override Expression VisitMember(MemberExpression node)
System\Linq\Expressions\ExpressionVisitor.cs (2)
369/// Visits the children of the <see cref="MemberExpression"/>. 374protected internal virtual Expression VisitMember(MemberExpression node)
System\Linq\Expressions\Interpreter\LightCompiler.cs (7)
652var member = (MemberExpression)node.Left; 2237return ((MemberExpression)node).Member is FieldInfo; 2303var member = (MemberExpression)node; 2440var node = (MemberExpression)expr;
System\Linq\Expressions\MemberExpression.cs (32)
45internal static MemberExpression Make(Expression? expression, MemberInfo member) 48return fi == null ? (MemberExpression)Make(expression, (PropertyInfo)member) : Make(expression, fi); 78public MemberExpression Update(Expression? expression) 122/// Creates a <see cref="MemberExpression"/> accessing a field. 126/// <returns>The created <see cref="MemberExpression"/>.</returns> 127public static MemberExpression Field(Expression? expression, FieldInfo field) 144return MemberExpression.Make(expression, field); 148/// Creates a <see cref="MemberExpression"/> accessing a field. 152/// <returns>The created <see cref="MemberExpression"/>.</returns> 154public static MemberExpression Field(Expression expression, string fieldName) 170/// Creates a <see cref="MemberExpression"/> accessing a field. 175/// <returns>The created <see cref="MemberExpression"/>.</returns> 176public static MemberExpression Field( 200/// Creates a <see cref="MemberExpression"/> accessing a property. 204/// <returns>The created <see cref="MemberExpression"/>.</returns> 206public static MemberExpression Property(Expression expression, string propertyName) 221/// Creates a <see cref="MemberExpression"/> accessing a property. 226/// <returns>The created <see cref="MemberExpression"/>.</returns> 227public static MemberExpression Property( 245/// Creates a <see cref="MemberExpression"/> accessing a property. 249/// <returns>The created <see cref="MemberExpression"/>.</returns> 250public static MemberExpression Property(Expression? expression, PropertyInfo property) 290return MemberExpression.Make(expression, property); 294/// Creates a <see cref="MemberExpression"/> accessing a property. 298/// <returns>The created <see cref="MemberExpression"/>.</returns> 300public static MemberExpression Property(Expression? expression, MethodInfo propertyAccessor) 354/// Creates a <see cref="MemberExpression"/> accessing a property or field. 358/// <returns>The created <see cref="MemberExpression"/>.</returns> 360public static MemberExpression PropertyOrField(Expression expression, string propertyOrFieldName) 381/// Creates a <see cref="MemberExpression"/> accessing a property or field. 385/// <returns>The created <see cref="MemberExpression"/>.</returns> 386public static MemberExpression MakeMemberAccess(Expression? expression, MemberInfo member)
System\Linq\Expressions\MemberInitExpression.cs (1)
104MemberExpression member = Expression.MakeMemberAccess(objVar, binding.Member);
System\Linq\Expressions\UnaryExpression.cs (2)
178var member = (MemberExpression)Operand;
System\Linq\Expressions\Utils.cs (1)
61public static MemberExpression GetStrongBoxValueField(Expression strongbox)
System.Private.Xml (1)
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (1)
2077var fieldExpr = Expression.Field(objectParam, fieldInfo);