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); }
public bool CanProcess(string operand, ParameterExpression paramExpression) { var propInfo = propertyInfo.GetPropertyInfoFromPath(operand, paramExpression.Type); return(propInfo != null); }