Skip to content

Fix EF Core 10 migration: Remove obsolete test fixture base classes#97

Merged
renemadsen merged 2 commits intomasterfrom
copilot/fix-dotnet-10-migration-errors
Nov 15, 2025
Merged

Fix EF Core 10 migration: Remove obsolete test fixture base classes#97
renemadsen merged 2 commits intomasterfrom
copilot/fix-dotnet-10-migration-errors

Conversation

Copy link

Copilot AI commented Nov 15, 2025

EF Core 10 removed SingletonInterceptorsFixtureBase and NonSharedModelBulkUpdatesFixtureBase, replacing them with a simplified NonSharedFixture pattern using primary constructors.

Changes

  • MaterializationInterceptionMySqlTest.cs: Replaced custom MySqlMaterializationInterceptionFixture with NonSharedFixture injection via primary constructor
  • NonSharedModelBulkUpdatesMySqlTest.cs: Replaced custom MySqlNonSharedModelBulkUpdatesFixture with NonSharedFixture injection via primary constructor

Before/After

// Before (EF Core 9)
public class MaterializationInterceptionMySqlTest : MaterializationInterceptionTestBase<...>
{
    public MaterializationInterceptionMySqlTest()
        : base(new MySqlMaterializationInterceptionFixture())
    { }
    
    public class MySqlMaterializationInterceptionFixture : SingletonInterceptorsFixtureBase
    {
        protected override IServiceCollection InjectInterceptors(...) => ...;
    }
}

// After (EF Core 10)
public class MaterializationInterceptionMySqlTest(NonSharedFixture fixture) :
    MaterializationInterceptionTestBase<...>(fixture)
{
}

Aligns with EF Core 10's SqlServer and Sqlite provider test patterns.

Original prompt

This section details on the original issue you should resolve

<issue_title>Handle migration to .net 10 compliation errors</issue_title>
<issue_description>We have these errors, that needs to be addressed for being able to migrate to .net 10:

Error: /home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/test/EFCore.MySql.FunctionalTests/MaterializationInterceptionMySqlTest.cs(35,60): error CS0246: The type or namespace name 'SingletonInterceptorsFixtureBase' could not be found (are you missing a using directive or an assembly reference?) [/home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/test/EFCore.MySql.FunctionalTests/EFCore.MySql.FunctionalTests.csproj]
Error: /home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/test/EFCore.MySql.FunctionalTests/MaterializationInterceptionMySqlTest.cs(41,13): error CS0246: The type or namespace name 'IServiceCollection' could not be found (are you missing a using directive or an assembly reference?) [/home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/test/EFCore.MySql.FunctionalTests/EFCore.MySql.FunctionalTests.csproj]
Error: /home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/test/EFCore.MySql.FunctionalTests/MaterializationInterceptionMySqlTest.cs(42,13): error CS0246: The type or namespace name 'IEnumerable<>' could not be found (are you missing a using directive or an assembly reference?) [/home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/test/EFCore.MySql.FunctionalTests/EFCore.MySql.FunctionalTests.csproj]
Error: /home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/test/EFCore.MySql.FunctionalTests/MaterializationInterceptionMySqlTest.cs(42,25): error CS0246: The type or namespace name 'IInterceptor' could not be found (are you missing a using directive or an assembly reference?) [/home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/test/EFCore.MySql.FunctionalTests/EFCore.MySql.FunctionalTests.csproj]
Error: /home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/test/EFCore.MySql.FunctionalTests/MaterializationInterceptionMySqlTest.cs(40,28): error CS0246: The type or namespace name 'IServiceCollection' could not be found (are you missing a using directive or an assembly reference?) [/home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/test/EFCore.MySql.FunctionalTests/EFCore.MySql.FunctionalTests.csproj]
Error: /home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/test/EFCore.MySql.FunctionalTests/BulkUpdates/NonSharedModelBulkUpdatesMySqlTest.cs(20,58): error CS0246: The type or namespace name 'NonSharedModelBulkUpdatesFixtureBase' could not be found (are you missing a using directive or an assembly reference?) [/home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/test/EFCore.MySql.FunctionalTests/EFCore.MySql.FunctionalTests.csproj]
```</issue_description>

<agent_instructions>Investigate ef core codebase to figure, what is needed to migrate these parts of the code, so we do not have these errors.</agent_instructions>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


💡 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.

Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix migration errors for .net 10 compilation Fix EF Core 10 migration: Remove obsolete test fixture base classes Nov 15, 2025
Copilot AI requested a review from renemadsen November 15, 2025 11:02
@renemadsen renemadsen marked this pull request as ready for review November 15, 2025 11:30
@renemadsen renemadsen merged commit bd07cc1 into master Nov 15, 2025
1 of 55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle migration to .net 10 compliation errors

2 participants