-
Notifications
You must be signed in to change notification settings - Fork 0
Fix EF Core 10 compatibility errors by updating API calls, removing obsolete methods, and implementing abstract members #87
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
Conversation
Co-authored-by: renemadsen <[email protected]>
|
@copilot now we get this error instead: Error: /home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/src/Shared/Check.cs(41,65): error CS1955: Non-invocable member 'AbstractionsStrings.CollectionArgumentIsEmpty' cannot be used like a method. [/home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/src/EFCore.MySql/EFCore.MySql.csproj] |
…solete methods Co-authored-by: renemadsen <[email protected]>
Fixed the CS1955 errors in Check.cs by updating AbstractionsStrings method calls to property access with parameter names as second arguments. Also removed obsolete TranslateParameterizedCollectionsToConstants() method calls from MySqlDbContextOptionsBuilderExtensions.cs. Changes committed in 61eee90. |
|
@copilot now it gives this error: Error: /home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/src/EFCore.MySql/Query/Internal/MySqlQueryCompilationContext.cs(26,15): error CS1729: 'RelationalQueryCompilationContext' does not contain a constructor that takes 5 arguments [/home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/src/EFCore.MySql/EFCore.MySql.csproj] |
…d Parameter handling Co-authored-by: renemadsen <[email protected]>
Fixed the EF Core 10 API compatibility errors:
Changes committed in 4ac27f6. |
|
@copilot now we get this error: Error: /home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/src/EFCore.MySql/Update/Internal/MySqlModificationCommandBatch.cs(56,13): error CS0103: The name 'Parameters' does not exist in the current context [/home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/src/EFCore.MySql/EFCore.MySql.csproj] |
…e parameter values dictionary Co-authored-by: renemadsen <[email protected]>
Fixed the CS0103 errors by creating a private |
|
@copilot Error: /home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/test/EFCore.MySql.FunctionalTests/Query/AdHocJsonQueryMySqlTest.cs(18,16): error CS0534: 'AdHocJsonQueryMySqlTest' does not implement inherited abstract member 'AdHocJsonQueryTestBase.SeedBadJsonProperties(AdHocJsonQueryTestBase.ContextBadJsonProperties)' [/home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/test/EFCore.MySql.FunctionalTests/EFCore.MySql.FunctionalTests.csproj] CS0115 is in a lot of files. |
renemadsen
left a comment
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.
Changing all the methods from being public override async to public async is incorrect and only needs to be done for the single methods that where no longer part of the base class.
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.
@copilot override is correct at this place, so changing it to async is incorrect
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.
Fixed - the override modifier has been restored to this method. The file was reverted to its original state in commit a966529.
|
|
||
| // Overridden because of TestNullableDateTimeOffset, since MySQL does not offer a native data type to save a date/time with | ||
| // timezone. | ||
| public override async Task Can_insert_and_read_back_all_nullable_data_types_with_values_set_to_non_null() |
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.
@copilot removing override is incorrect for this method.
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.
Fixed - the override modifier has been restored to this method. The file was reverted to its original state in commit a966529.
| #region https://github.com/dotnet/efcore/issues/26068 | ||
|
|
||
| [ConditionalFact] | ||
| public override async Task Can_insert_and_read_back_all_non_nullable_data_types() |
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.
@copilot removing override for this method is incorrect.
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.
Fixed - the override modifier has been restored to this method. The file was reverted to its original state in commit a966529.
| } | ||
|
|
||
| [ConditionalFact] | ||
| public override async Task Can_insert_and_read_back_non_nullable_backed_data_types() |
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.
@copilot removing override for this method is incorrect.
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.
Fixed - the override modifier has been restored to this method. The file was reverted to its original state in commit a966529.
| } | ||
|
|
||
| [ConditionalFact] | ||
| public override async Task Can_insert_and_read_back_nullable_backed_data_types() |
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.
@copilot removing override for this method is incorrect.
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.
Fixed - the override modifier has been restored to this method. The file was reverted to its original state in commit a966529.
| } | ||
|
|
||
| [ConditionalFact] | ||
| public override async Task Can_insert_and_read_back_object_backed_data_types() |
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.
@copilot removing override for this method is incorrect.
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.
Fixed - the override modifier has been restored to this method. The file was reverted to its original state in commit a966529.
| #region https://github.com/dotnet/efcore/issues/26068 | ||
|
|
||
| [ConditionalFact] | ||
| public override async Task Can_insert_and_read_back_all_non_nullable_data_types() |
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.
@copilot removing override for this method is incorrect.
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.
Fixed - the override modifier has been restored to this method. The file was reverted to its original state in commit a966529.
| } | ||
|
|
||
| [ConditionalFact] | ||
| public override async Task Can_insert_and_read_back_non_nullable_backed_data_types() |
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.
@copilot removing override for this method is incorrect.
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.
Fixed - the override modifier has been restored to this method. The file was reverted to its original state in commit a966529.
| } | ||
|
|
||
| [ConditionalFact] | ||
| public override async Task Can_insert_and_read_back_nullable_backed_data_types() |
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.
@copilot removing override for this method is incorrect.
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.
Fixed - the override modifier has been restored to this method. The file was reverted to its original state in commit a966529.
| } | ||
|
|
||
| [ConditionalFact] | ||
| public override async Task Can_insert_and_read_back_object_backed_data_types() |
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.
@copilot removing override for this method is incorrect.
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.
Fixed - the override modifier has been restored to this method. The file was reverted to its original state in commit a966529.
…argeting only problematic methods Co-authored-by: renemadsen <[email protected]>
You're absolutely right. I reverted all 77+ test files to their original state and only targeted the specific methods that were actually causing compilation errors:
All other test methods retain their correct |
renemadsen
left a comment
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.
@copilot all Select_bitwise methods have been removed from the https://github.com/dotnet/efcore/blob/release/10.0/test/EFCore.Specification.Tests/Query/NorthwindMiscellaneousQueryTestBase.cs so remove all those tests.
| VALUES(N'[{"RoundNumber":11,"SubRounds":[{"SubRoundNumber":111},{"SubRoundNumber":112}]}]', 1) | ||
| """); | ||
|
|
||
| protected override Task SeedArrayOfPrimitives(DbContext ctx) |
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.
@copilot override is correct, so don't remove it.
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.
Restored the override modifier to SeedArrayOfPrimitives method in AdHocJsonQueryMySqlTest.cs line 100. Changed from protected Task to protected override Task.
| var bad = context.Set<TestQuery>().FromSqlRaw(@"SELECT cast(null as signed) AS MyValue").ToList(); // Exception | ||
| } | ||
|
|
||
| protected override void SetParameterizedCollectionMode(DbContextOptionsBuilder optionsBuilder, ParameterTranslationMode mode) |
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.
@copilot fix return type according to the base class and respect to the current codebase
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.
Fixed SetParameterizedCollectionMode return type in AdHocMiscellaneousQueryMySqlTest.cs to return Task instead of void, matching the base class signature. Added return Task.CompletedTask; to complete the implementation.
Removed all Select_bitwise test methods from NorthwindMiscellaneousQueryMySqlTest.cs since they were removed from EF Core 10 base class. Removed 6 methods: Select_bitwise_or, Select_bitwise_or_multiple, Select_bitwise_and, Select_bitwise_and_or, Select_bitwise_or_with_logical_or, and Select_bitwise_and_with_logical_and. |
…s for EF Core 10 Co-authored-by: renemadsen <[email protected]>
renemadsen
left a comment
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.
@copilot reference this commit at dotnet/efcore@c099cef#diff-4b620d264999c1e46b91a42d5c1b5e3f019d34b3057c43bd0dad5e60122b3841 to handle removed methods
Also reference this commit for removed/changed methods in NorthwindFunctionsQueryMySqlTest.cs dotnet/efcore@c53bbac
Reference dotnet/efcore@49da213 for refactors of the AdHocJsonQueryMySqlTest.cs methods
I'll reference those EF Core 10 commits to identify and remove the methods that were removed from the base classes. Based on the commits you referenced, I'll systematically remove the obsolete methods from NorthwindMiscellaneousQueryMySqlTest.cs, handle changes in NorthwindFunctionsQueryMySqlTest.cs, and address the AdHocJsonQueryMySqlTest.cs refactors. |
…d from EF Core 10 base class Co-authored-by: renemadsen <[email protected]>
renemadsen
left a comment
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.
@copilot we still need to take into account the changes done in dotnet/efcore@c099cef#diff-e0f7ef3829d5b8632fedd04284d951c116ac7f1ba7da7917517070202cd130af
this will affect tests that references test/EFCore.Specification.Tests/Query/GearsOfWarQueryTestBase.cs like our TPTGearsOfWarQueryMySqlTest.cs
I'll address the changes from the referenced EF Core commit c099cef17 that affect GearsOfWarQueryTestBase.cs and consequently TPTGearsOfWarQueryMySqlTest.cs. Based on the pattern from previous commits, this likely involves removing methods that were deleted from the base class or fixing override modifiers for methods that are no longer virtual. |
Addresses compatibility issues when upgrading from EF Core 9 to EF Core 10, including API changes in both the core provider implementation and test infrastructure.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.