private static SqlQuerySpec HandleMethodCallExpression(MethodCallExpression expression) { if (DocumentQueryEvaluator.IsTransformExpression(expression)) { if (string.Compare(expression.Method.Name, DocumentQueryEvaluator.SQLMethod, StringComparison.Ordinal) == 0) { return(DocumentQueryEvaluator.HandleAsSqlTransformExpression(expression)); } else { throw new DocumentQueryException( string.Format(CultureInfo.CurrentUICulture, ClientResources.BadQuery_InvalidExpression, expression.ToString())); } } if (DocumentQueryEvaluator.IsSupportedMethod(expression)) { return(SqlTranslator.TranslateQuery(expression)); } throw new DocumentQueryException( string.Format(CultureInfo.CurrentUICulture, ClientResources.BadQuery_InvalidExpression, expression.ToString())); }
private static SqlQuerySpec HandleMethodCallExpression( MethodCallExpression expression, IDictionary <object, string> parameters, CosmosSerializationOptions serializationOptions = null) { if (DocumentQueryEvaluator.IsTransformExpression(expression)) { if (string.Compare(expression.Method.Name, DocumentQueryEvaluator.SQLMethod, StringComparison.Ordinal) == 0) { return(DocumentQueryEvaluator.HandleAsSqlTransformExpression(expression)); } else { throw new DocumentQueryException( string.Format(CultureInfo.CurrentUICulture, ClientResources.BadQuery_InvalidExpression, expression.ToString())); } } return(SqlTranslator.TranslateQuery(expression, serializationOptions, parameters)); }