-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Added Support for translating Array.IndexOf methods for byte arrays for SqlServer & SQLite #34457
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
d7f8d7b
d81a857
ec0b63d
5a2d7ff
e84752b
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 | ||||
---|---|---|---|---|---|---|
|
@@ -6259,6 +6259,104 @@ public virtual Task Byte_array_filter_by_length_parameter(bool async) | |||||
ss => ss.Set<Squad>().Where(w => w.Banner != null && w.Banner.Length == someByteArr.Length)); | ||||||
} | ||||||
|
||||||
#region Byte Array IndexOf | ||||||
|
||||||
[ConditionalTheory] | ||||||
[MemberData(nameof(IsAsyncData))] | ||||||
public virtual Task Byte_array_of_type_varbinary_max_filter_by_index_of_literal_casts_to_int(bool async) | ||||||
nikhil197 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
{ | ||||||
return AssertQuery( | ||||||
async, | ||||||
ss => ss.Set<Squad>().Where(w => Array.IndexOf(w.Banner, (byte)1) == 1), | ||||||
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. The cast here shouldn't be needed, no?
Suggested change
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 actually, it is needed. Without this it's picking non-generic version of the method Do we want to support that too? |
||||||
ss => ss.Set<Squad>().Where(w => w.Banner != null && Array.IndexOf(w.Banner, (byte)1) == 1) | ||||||
); | ||||||
nikhil197 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
} | ||||||
|
||||||
[ConditionalTheory] | ||||||
[MemberData(nameof(IsAsyncData))] | ||||||
public virtual Task Byte_array_of_type_varbinary_max_filter_by_index_of_parameter_casts_to_int(bool async) | ||||||
{ | ||||||
byte b = 0; | ||||||
return AssertQuery( | ||||||
async, | ||||||
ss => ss.Set<Squad>().Where(w => Array.IndexOf(w.Banner, b) == 0), | ||||||
ss => ss.Set<Squad>().Where(w => w.Banner != null && Array.IndexOf(w.Banner, b) == 0) | ||||||
); | ||||||
} | ||||||
|
||||||
[ConditionalTheory] | ||||||
[MemberData(nameof(IsAsyncData))] | ||||||
public virtual Task Byte_array_of_type_varbinary_n_filter_by_index_of_literal_does_not_cast(bool async) | ||||||
{ | ||||||
return AssertQuery( | ||||||
async, | ||||||
ss => ss.Set<Squad>().Where(w => Array.IndexOf(w.Banner5, (byte)5) == 1), | ||||||
ss => ss.Set<Squad>().Where(w => w.Banner != null && Array.IndexOf(w.Banner5, (byte)5) == 1) | ||||||
); | ||||||
} | ||||||
|
||||||
[ConditionalTheory] | ||||||
[MemberData(nameof(IsAsyncData))] | ||||||
public virtual Task Byte_array_of_type_varbinary_n_filter_by_index_of_parameter_does_not_cast(bool async) | ||||||
{ | ||||||
byte b = 4; | ||||||
return AssertQuery( | ||||||
async, | ||||||
ss => ss.Set<Squad>().Where(w => Array.IndexOf(w.Banner5, b) == 0), | ||||||
ss => ss.Set<Squad>().Where(w => w.Banner != null && Array.IndexOf(w.Banner5, b) == 0) | ||||||
); | ||||||
} | ||||||
|
||||||
[ConditionalTheory] | ||||||
[MemberData(nameof(IsAsyncData))] | ||||||
public virtual Task Byte_array_of_type_varbinary_max_filter_by_index_of_with_starting_position_literal_casts_to_int(bool async) | ||||||
{ | ||||||
return AssertQuery( | ||||||
async, | ||||||
ss => ss.Set<Squad>().Where(w => Array.IndexOf(w.Banner, (byte)1, 1) == 1), | ||||||
ss => ss.Set<Squad>().Where(w => w.Banner != null && Array.IndexOf(w.Banner, (byte)1, 1) == 1) | ||||||
); | ||||||
} | ||||||
|
||||||
[ConditionalTheory] | ||||||
[MemberData(nameof(IsAsyncData))] | ||||||
public virtual Task Byte_array_of_type_varbinary_max_filter_by_index_of_with_starting_position_parameter_casts_to_int(bool async) | ||||||
{ | ||||||
byte b = 0; | ||||||
int startPos = 0; | ||||||
return AssertQuery( | ||||||
async, | ||||||
ss => ss.Set<Squad>().Where(w => Array.IndexOf(w.Banner, b, startPos) == 0), | ||||||
ss => ss.Set<Squad>().Where(w => w.Banner != null && Array.IndexOf(w.Banner, b, startPos) == 0) | ||||||
); | ||||||
} | ||||||
|
||||||
[ConditionalTheory] | ||||||
[MemberData(nameof(IsAsyncData))] | ||||||
public virtual Task Byte_array_of_type_varbinary_n_filter_by_index_of_with_starting_position_literal_does_not_cast(bool async) | ||||||
{ | ||||||
return AssertQuery( | ||||||
async, | ||||||
ss => ss.Set<Squad>().Where(w => Array.IndexOf(w.Banner5, (byte)5, 1) == 1), | ||||||
ss => ss.Set<Squad>().Where(w => w.Banner != null && Array.IndexOf(w.Banner5, (byte)5, 1) == 1) | ||||||
); | ||||||
} | ||||||
|
||||||
[ConditionalTheory] | ||||||
[MemberData(nameof(IsAsyncData))] | ||||||
public virtual Task Byte_array_of_type_varbinary_n_filter_by_index_of_with_starting_position_parameter_does_not_cast(bool async) | ||||||
{ | ||||||
byte b = 4; | ||||||
int startPos = 0; | ||||||
return AssertQuery( | ||||||
async, | ||||||
ss => ss.Set<Squad>().Where(w => Array.IndexOf(w.Banner5, b, startPos) == 0), | ||||||
ss => ss.Set<Squad>().Where(w => w.Banner != null && Array.IndexOf(w.Banner5, b, startPos) == 0) | ||||||
); | ||||||
} | ||||||
|
||||||
#endregion | ||||||
|
||||||
[ConditionalTheory] | ||||||
[MemberData(nameof(IsAsyncData))] | ||||||
public virtual Task OrderBy_bool_coming_from_optional_navigation(bool async) | ||||||
|
Uh oh!
There was an error while loading. Please reload this page.