-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Added Support for translating Array.IndexOf methods for byte arrays for SqlServer & SQLite #34457
base: main
Are you sure you want to change the base?
Conversation
@dotnet-policy-service agree |
test/EFCore.Specification.Tests/Query/GearsOfWarQueryTestBase.cs
Outdated
Show resolved
Hide resolved
Hi @roji |
src/EFCore.SqlServer/Query/Internal/Translators/SqlServerByteArrayMethodTranslator.cs
Outdated
Show resolved
Hide resolved
src/EFCore.SqlServer/Query/Internal/Translators/SqlServerByteArrayMethodTranslator.cs
Outdated
Show resolved
Hide resolved
src/EFCore.SqlServer/Query/Internal/Translators/SqlServerByteArrayMethodTranslator.cs
Outdated
Show resolved
Hide resolved
src/EFCore.SqlServer/Query/Internal/Translators/SqlServerByteArrayMethodTranslator.cs
Show resolved
Hide resolved
src/EFCore.Sqlite.Core/Query/Internal/Translators/SqliteByteArrayMethodTranslator.cs
Outdated
Show resolved
Hide resolved
test/EFCore.Specification.Tests/Query/GearsOfWarQueryTestBase.cs
Outdated
Show resolved
Hide resolved
public virtual Task Byte_array_with_max_possible_length_filter_by_index_of_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 comment
The reason will be displayed to describe this comment to others. Learn more.
The cast here shouldn't be needed, no?
ss => ss.Set<Squad>().Where(w => Array.IndexOf(w.Banner, (byte)1) == 1), | |
ss => ss.Set<Squad>().Where(w => Array.IndexOf(w.Banner, 1) == 1), |
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.
No actually, it is needed. Without this it's picking non-generic version of the method IndexOf(Array arr, object value)
(because 1 is an Int32 by default and I haven't specified the type argument on the IndexOf).
Do we want to support that too?
test/EFCore.Specification.Tests/Query/GearsOfWarQueryTestBase.cs
Outdated
Show resolved
Hide resolved
test/EFCore.Specification.Tests/Query/GearsOfWarQueryTestBase.cs
Outdated
Show resolved
Hide resolved
Hi @roji |
Added Support for translating byte[].IndexOf method for Sql Server & SQLite
Added tests for the same
Fixes Query: Translate byte array.IndexOf #19287
I've read the guidelines for contributing and seen the walkthrough
I've posted a comment on an issue with a detailed description of how I am planning to contribute and got approval from a member of the team
The code builds and tests pass locally (also verified by our automated build checks)
Commit messages follow this format: