-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add translation of string.Join overload used with List<string> parameter, fix #3105 #3106
Changes from 2 commits
2818b72
ccfdc1f
c63416e
bc15b0e
b27e530
a700ef9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -876,9 +876,9 @@ WHERE COALESCE(array_position(s."IntList", 6, 2) - 1, -1) = 1 | |
} | ||
|
||
// Note: see NorthwindFunctionsQueryNpgsqlTest.String_Join_non_aggregate for regular use without an array column/parameter | ||
public override async Task String_Join_with_array_parameter(bool async) | ||
public override async Task String_Join_with_array_of_int_parameter(bool async) | ||
{ | ||
await base.String_Join_with_array_parameter(async); | ||
await base.String_Join_with_array_of_int_parameter(async); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This actually seems mis-named (before your PR) - the array of int is a column, not a parameter. Can you please rename to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if something after your
was cut off? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, nothing important. |
||
|
||
AssertSql( | ||
""" | ||
|
@@ -888,6 +888,25 @@ WHERE array_to_string(s."IntList", ', ', '') = '3, 4' | |
"""); | ||
} | ||
|
||
[ConditionalTheory] | ||
[MemberData(nameof(IsAsyncData))] | ||
public async Task String_Join_with_array_of_string_parameter(bool async) | ||
{ | ||
// This is not in ArrayQueryTest because string.Join uses another overload for string[] than for List<string> and thus | ||
// ArrayToListReplacingExpressionVisitor won't work. | ||
await AssertQuery( | ||
async, | ||
ss => ss.Set<ArrayEntity>() | ||
.Where(e => string.Join(", ", e.StringList) == "3, 4")); | ||
|
||
AssertSql( | ||
""" | ||
SELECT s."Id", s."ArrayContainerEntityId", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArray", s."ValueConvertedList", s."Varchar10", s."Varchar15" | ||
FROM "SomeEntities" AS s | ||
WHERE array_to_string(s."StringList", ', ', '') = '3, 4' | ||
"""); | ||
} | ||
|
||
#endregion Other translations | ||
|
||
public class ArrayListQueryFixture : ArrayQueryFixture | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍