Expression.Field Method (Expression, String)
Creates a MemberExpression that represents accessing a field given the name of the field.
Assemblies: System.Core (in System.Core.dll)
System.Linq.Expressions (in System.Linq.Expressions.dll)
static member Field : expression:Expression * fieldName:string -> MemberExpression
- Type: System.Linq.Expressions.Expression
- Type: System.String
The name of a field to be accessed.
This method searches expression.Type and its base types for a field that has the name fieldName. Public fields are given preference over non-public fields. If a matching field is found, this method passes expression and the FieldInfo that represents that field to Field.