System.Linq.Expressions.Expression.Property C# (CSharp) Method

Property() public static method

Creates an IndexExpression representing the access to an indexed property.
public static Property ( Expression instance, PropertyInfo indexer ) : IndexExpression
instance Expression The object to which the property belongs. If the property is static/shared, it must be null.
indexer PropertyInfo The that represents the property to index.
return IndexExpression
        public static IndexExpression Property(Expression instance, PropertyInfo indexer, params Expression[] arguments)
        {
            return Property(instance, indexer, (IEnumerable<Expression>)arguments);
        }

Same methods

Expression::Property ( Expression instance, PropertyInfo indexer, IEnumerable arguments ) : IndexExpression
Expression::Property ( Expression instance, string propertyName ) : IndexExpression
Expression::Property ( Expression expression, MethodInfo propertyAccessor ) : MemberExpression
Expression::Property ( Expression expression, PropertyInfo property ) : MemberExpression
Expression::Property ( Expression expression, Type type, string propertyName ) : MemberExpression
Expression::Property ( Expression expression, string propertyName ) : MemberExpression

Usage Example

Ejemplo n.º 1
0
        private static Expression <Func <T, bool> > PrimaryKeyEquals(PropertyInfo property, int value)
        {
            var param = Expression.Parameter(typeof(T));
            var body  = Expression.Equal(Expression.Property(param, property), Expression.Constant(value));

            return(Expression.Lambda <Func <T, bool> >(body, param));
        }
All Usage Examples Of System.Linq.Expressions.Expression::Property
Expression