-
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 all 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 | ||||
---|---|---|---|---|---|---|
|
@@ -6258,6 +6258,88 @@ 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_IndexOf_with_literal(bool async) | ||||||
=> 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)); | ||||||
|
||||||
[ConditionalTheory] | ||||||
[MemberData(nameof(IsAsyncData))] | ||||||
public virtual Task Byte_array_IndexOf_with_parameter(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_with_length_IndexOf_with_literal(bool async) | ||||||
=> 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_with_length_IndexOf_with_parameter(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_IndexOf_with_startIndex_with_literals(bool async) | ||||||
=> 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_IndexOf_with_startIndex_with_parameters(bool async) | ||||||
{ | ||||||
byte b = 0; | ||||||
var 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_with_length_IndexOf_with_startIndex_with_literals(bool async) | ||||||
=> 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_with_length_IndexOf_with_startIndex_with_parameters(bool async) | ||||||
{ | ||||||
byte b = 4; | ||||||
var 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.