Skip to content

Commit 887d5bb

Browse files
author
leminh98
committed
remove debug strings
1 parent 28a045b commit 887d5bb

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

Microsoft.Azure.Cosmos/src/Linq/BuiltinFunctions/StringBuiltinFunctions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ protected override SqlScalarExpression VisitImplicit(MethodCallExpression method
6666
{
6767
if (methodCallExpression.Arguments.Count == 2)
6868
{
69-
Console.WriteLine("Im here");
7069
SqlScalarExpression haystack = ExpressionToSql.VisitScalarExpression(methodCallExpression.Object, context);
7170
SqlScalarExpression needle = ExpressionToSql.VisitScalarExpression(methodCallExpression.Arguments[0], context);
7271
SqlScalarExpression caseSensitivity = SqlStringWithComparisonVisitor.GetCaseSensitivityExpression(methodCallExpression.Arguments[1]);

Microsoft.Azure.Cosmos/src/Linq/ConstantEvaluator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private static bool CanBeEvaluated(Expression expression)
5050
{
5151
Type type = methodCallExpression.Method.DeclaringType;
5252

53-
// Aside from the known types, we also need to avoid partial eval for op_implicit methods, which are the implicit conversions of enum to memoryextension span types (introduced in c#14)
53+
// Aside from the known types, we also need to avoid partial eval for op_implicit methods, which are the implicit conversions of enum to memoryextension span types (introduced in c#13)
5454
if (type == typeof(Enumerable) || type == typeof(Queryable) || type == typeof(CosmosLinq) || methodCallExpression.Method.Name == "op_Implicit")
5555
{
5656
return false;

Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1153,8 +1153,8 @@ private static Collection VisitMemberAccessCollectionExpression(Expression input
11531153
private static Collection VisitMethodCall(MethodCallExpression inputExpression, TranslationContext context)
11541154
{
11551155
context.PushMethod(inputExpression);
1156+
11561157
Type declaringType = inputExpression.Method.DeclaringType;
1157-
11581158
if ((declaringType != typeof(Queryable)
11591159
&& declaringType != typeof(Enumerable) /*LINQ Methods*/
11601160
&& declaringType != typeof(CosmosLinqExtensions) /*OrderByRank*/)

Microsoft.Azure.Cosmos/tests/CosmosDbDemo/Program.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,12 @@ public async Task Main()
4646
await container.CreateItemAsync(todoItem);
4747
Console.WriteLine($"Created item: {todoItem.id}");
4848

49-
string[] someStringArray = ["a"];
49+
string[] someStringArray = ["Learn Cosmos DB"];
5050
IOrderedQueryable<TodoItem> queryable = container.GetItemLinqQueryable<TodoItem>();
51-
IQueryable<TodoItem> query = queryable.Where(item => someStringArray.Contains(item.id));
51+
IQueryable<TodoItem> query = queryable.Where(item => someStringArray.Contains(item.Title));
52+
53+
string querytest = query.ToQueryDefinition().QueryText;
54+
Console.WriteLine($"Generated SQL Query: {querytest}");
5255

5356
using FeedIterator<TodoItem> feed = query.ToFeedIterator();
5457

0 commit comments

Comments
 (0)