Repository: dotnet/efcore
File: test/EFCore.Specification.Tests/Query/JsonQueryFixtureBase.cs (C#)

Code before:
            });

        modelBuilder.Entity<JsonEntityConverters>().Property(x => x.Id).ValueGeneratedNever();
        modelBuilder.Entity<JsonEntityConverters>().OwnsOne(
            x => x.Reference, b =>
            {
                b.Property(x => x.BoolConvertedToIntZeroOne).HasConversion<BoolToZeroOneConverter<int>>();
                b.Property(x => x.BoolConvertedToStringTrueFalse).HasConversion(new BoolToStringConverter("False", "True"));
                b.Property(x => x.BoolConvertedToStringYN).HasConversion(new BoolToStringConverter("N", "Y"));
                b.Property(x => x.IntZeroOneConvertedToBool).HasConversion(
                    new ValueConverter<int, bool>(
                        x => x == 0 ? false : true,
                        x => x == false ? 0 : 1));

                b.Property(x => x.StringTrueFalseConvertedToBool).HasConversion(
                    new ValueConverter<string, bool>(
                        x => x == "True" ? true : false,
                        x => x == true ? "True" : "False"));

                b.Property(x => x.StringYNConvertedToBool).HasConversion(
                    new ValueConverter<string, bool>(
                        x => x == "Y" ? true : false,
                        x => x == true ? "Y" : "N"));
            });

        modelBuilder.Entity<JsonEntityTphItem>(b =>
        {
            b.Property(x => x.Id).ValueGeneratedNever();
            b.HasMany(x => x.Attributes).WithOne().HasForeignKey(x => x.JsonEntityTphItemId);
        });

        modelBuilder.Entity<JsonEntityTphItemAttribute>(b =>
        {
            b.HasKey(x => new { x.JsonEntityTphItemId, x.Key });
            b.HasDiscriminator<string>("Discriminator")
                .HasValue<JsonEntityTphStringAttribute>("string")
                .HasValue<JsonEntityTphLocaleAttribute>("locale-value");
        });
    }

    protected override string StoreName
        => "JsonQueryTest";

    protected override async Task SeedAsync(JsonQueryContext context)
        => await JsonQueryContext.SeedAsync(context);
}


Review comment (suggestion):
@copilot Instead of adding JsonEntityTphItem and other new classes, try to modify JsonEntityInheritanceBase, JsonEntityInheritanceDerived and their configuration to repro the original issue. Only keep new classes if the issue cannot by hit using JsonEntityInheritanceBase or JsonEntityInheritanceDerived

Code after:
            });

        modelBuilder.Entity<JsonEntityConverters>().Property(x => x.Id).ValueGeneratedNever();
        modelBuilder.Entity<JsonEntityConverters>().OwnsOne(
            x => x.Reference, b =>
            {
                b.Property(x => x.BoolConvertedToIntZeroOne).HasConversion<BoolToZeroOneConverter<int>>();
                b.Property(x => x.BoolConvertedToStringTrueFalse).HasConversion(new BoolToStringConverter("False", "True"));
                b.Property(x => x.BoolConvertedToStringYN).HasConversion(new BoolToStringConverter("N", "Y"));
                b.Property(x => x.IntZeroOneConvertedToBool).HasConversion(
                    new ValueConverter<int, bool>(
                        x => x == 0 ? false : true,
                        x => x == false ? 0 : 1));

                b.Property(x => x.StringTrueFalseConvertedToBool).HasConversion(
                    new ValueConverter<string, bool>(
                        x => x == "True" ? true : false,
                        x => x == true ? "True" : "False"));

                b.Property(x => x.StringYNConvertedToBool).HasConversion(
                    new ValueConverter<string, bool>(
                        x => x == "Y" ? true : false,
                        x => x == true ? "Y" : "N"));
            });
    }

    protected override string StoreName
        => "JsonQueryTest";

    protected override async Task SeedAsync(JsonQueryContext context)
        => await JsonQueryContext.SeedAsync(context);
}