public static DocumentPropertyBase GetMappingProperty(this Expression expression, MethodCallExpression method, IPropertyMappingResolver propertyMappingResolver, string rootPath) { DocumentPropertyBase result = null; string methodName = method.Arguments[0].ToString().Trim(_METHOD_NAME_DELIMITERS); if (method != null && method.Method.Name == WhereVisitor._ANY) { string propertyPath = methodName + _METHOD_NAME_DELIMITER + expression.ToString().Split(_METHOD_NAME_DELIMITERS)[1]; result = propertyMappingResolver.Resolve(propertyPath); } else if (string.IsNullOrEmpty(methodName)) { //result = expression.GetConstantName(propertyMappingResolver); } else { string propertyPath = methodName.Insert(0, rootPath + _METHOD_NAME_DELIMITER); propertyPath = propertyPath + _METHOD_NAME_DELIMITER + expression.ToString().Split(_METHOD_NAME_DELIMITERS)[1]; result = propertyMappingResolver.Resolve(propertyPath); } return result; }
public static DocumentPropertyBase GetMappingProperty(this Expression expression, IPropertyMappingResolver propertyMappingResolver) { string propertyPath = expression.ToString().Trim(_METHOD_NAME_DELIMITERS); return propertyMappingResolver.Resolve(propertyPath); }