Beispiel #1
0
        public Expression CreatePropertyExpression(string segment, ParameterExpression paramExpression)
        {
            var        segments           = segment.Split('.');
            Expression propertyExpression = null;
            var        propertyType       = paramExpression.Type;

            foreach (var prop in segments)
            {
                var propInfo = propertyInfoProvider.GetPropertyInfoFromPath(prop, propertyType);
                propertyExpression = Expression.Property(propertyExpression ?? paramExpression, propInfo);
            }

            return(propertyExpression);
        }
Beispiel #2
0
        public bool CanProcess(string operand, ParameterExpression paramExpression)
        {
            var propInfo = propertyInfo.GetPropertyInfoFromPath(operand, paramExpression.Type);

            return(propInfo != null);
        }